Skip to content

Conversation

@bart-degreed
Copy link
Contributor

@bart-degreed bart-degreed commented Mar 18, 2021

Our integration tests did actually test for compound values. But they use an internal loopback, which bypasses the actual Accept header parsing that occurs on incoming socket bytes.

Because httpContext.Request.Headers["Accept"] returns StringValues, I blindly assumed that this would break up comma-separated values. But it does not, as explained here. It only contains multiple entries when multiple Accept header lines are sent sequentially (or when short-circuited, as in our tests).

There seems no way to bypass the internal comma-separated values parsing that occurs in integration tests. Even passing a single comma-delimited string runs through an internal parser, producing a StringValues with multiple entries.

Fixes #970.

@maurei maurei merged commit 6289373 into master Mar 18, 2021
@maurei maurei deleted the accept-header-fix branch March 18, 2021 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Comma-delimited Accept header is not correctly parsed

3 participants