Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Content to all HttpResponseMessages #387

Merged

Commits on Feb 17, 2023

  1. Add Content to all HttpResponseMessages

    - fix aspnet#386
      - reenable `net6.0` tests disabled in aspnet#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
    dougbu committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    ecadf28 View commit details
    Browse the repository at this point in the history