Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

AddContent to allHttpResponseMessages#387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

dougbu
Copy link
Contributor

  • fixDo not exposeHttpResponseMessage.Content == null to user code #386
  • also, checkStream.CanSeek less when calculatingHttpMessageContent.ContentLength value
    • use innerHttpContent.Headers.ContentLength if available
    • this changes behaviour slightly for both requests and responses
      • observable asHttpMessageContent.Headers.ContentLength!=null for empty messages
    • for responses, avoidsContentLength==null versusContentLength==0 inconsistencies (depending on platform)
    • ContentLength==null may still occur in some corner cases (which existed before)
      • e.g. when innerHttpContent doesn't know its length andReadAsStreamAsync() hasn't completed
  • main change meansHttpResponseMessages we expose to user code are consistent across platforms
    • note: user code won't seeEmptyContent inHttpResponseMessages we create

-fix#386  - reenable `net6.0` tests disabled in#384 for this issue- also, check `Stream.CanSeek` less when calculating `HttpMessageContent.ContentLength` value  - use inner `HttpContent.Headers.ContentLength` if available  - this changes behaviour slightly for both requests and responses    - observable as `HttpMessageContent.Headers.ContentLength!=null` for empty messages  - for responses, avoids `ContentLength==null` versus `ContentLength==0` inconsistencies (depending on platform)  - `ContentLength==null` may still occur in some corner cases (which existed before)    - e.g. when inner `HttpContent` doesn't know its length and `ReadAsStreamAsync()` hasn't completed- main change means `HttpResponseMessage`s we expose to user code are consistent across platforms  - note: user code won't see `EmptyContent` in `HttpResponseMessage`s we create
Copy link
Member

@TratcherTratcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This version looks fine, but you say you're still seeing other issues?

@dougbu
Copy link
ContributorAuthor

This version looks fine, but you say you're still seeing other issues?

Not yet. I suspect there be a few more gremlins inHttpMessageContent, at least wrt.HttpMessageContent.ValidateStreamForReading(...). I haven't filed an issue about that or anything else my testing may turn up today. My plan is to do so and fix what I find in another PR.

@dougbudougbu merged commit979e6ac intoaspnet:mainFeb 17, 2023
@dougbudougbu deleted the dougbu/Newtonsoft.Json.net6.0/EmptyContent branchFebruary 17, 2023 20:14
@dougbudougbu added this to the3.3.0 (5.3.0) milestoneFeb 26, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@TratcherTratcherTratcher approved these changes

@stephentoubstephentoubAwaiting requested review from stephentoub

Assignees
No one assigned
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not exposeHttpResponseMessage.Content == null to user code
2 participants
@dougbu@Tratcher

[8]ページ先頭

©2009-2025 Movatter.jp