Skip to content

Conversation

mamaso
Copy link
Contributor

@mamaso mamaso commented Mar 23, 2017

resolves #1314

Copy link
Member

Choose a reason for hiding this comment

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

Do we have other tests passing multi-value headers, headers with quality, etc.? Would be good to make sure those are handled as expected.

Copy link
Contributor Author

@mamaso mamaso Mar 23, 2017

Choose a reason for hiding this comment

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

Another great comment, all of our multiple-value tests use User-Agent, which as mentioned in the other comment is its own special snowflake as it uses " " separator. I'll add some tests with the accept header which uses standard comma separators.

Copy link
Member

Choose a reason for hiding this comment

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

Why using an empty space and not a comma here? This is a bit confusing. How is this being interpreted and why are we not using a comma?

Copy link
Contributor Author

@mamaso mamaso Mar 23, 2017

Choose a reason for hiding this comment

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

Great question, after looking at this httpheaders comment I'm going to go back to the original serializing code. Probably not worth it trying to simplify if there are weird edge cases like this - though I think that beyond User-Agent, , separator is the standard

Copy link
Member

Choose a reason for hiding this comment

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

When concatenating these to ToString() values, is the first guaranteed to have a separator so they don't munge together?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will add a newline separator to ensure that the headers are split

Copy link
Member

Choose a reason for hiding this comment

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

The accept header is separated by commas + space - those are all parsed out the header collection ToString?

Copy link
Member

Choose a reason for hiding this comment

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

We have logic here https://github.com/Azure/azure-webjobs-sdk-script/blob/658d4d0c9dce9af940bd1a4fd8d5fb0f2fb85e90/src/WebJobs.Script/Binding/HttpBinding.cs#L290 that goes the other way - takes top level headers and applies them to a response. So what you're doing makes this symmetric for request content.

Copy link
Member

Choose a reason for hiding this comment

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

Can you add like 2 more content headers and verify them below to test the multiplicity? I.e. symmetric with https://github.com/Azure/azure-webjobs-sdk-script/blob/658d4d0c9dce9af940bd1a4fd8d5fb0f2fb85e90/src/WebJobs.Script/Binding/HttpBinding.cs#L290

Copy link
Member

@mathewc mathewc left a comment

Choose a reason for hiding this comment

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

Looks good!

@mamaso mamaso merged commit 7c60945 into Azure:dev Mar 30, 2017
@SteveALee
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Content-Type: Not passed in the Request Headers
6 participants