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

only sort the headers by key not by value #44

Merged
merged 2 commits into from Nov 21, 2013

Conversation

Projects
None yet
4 participants
@domruf
Contributor

domruf commented Sep 19, 2013

I have a application that offers different kinds of authentication methods (Basic and Negotiate).
The problem is that Firefox uses them in the order they are listed in the HTTP header.
waitress currently sorts the headers by key and value which because Firefox to use Basic instead of Negotiate because it starts with B.

only sort the headers by key not by value
--HG--
extra : rebase_source : 28c8db5c527838341f125e10f8ec770352c92b75
@mmerickel

This comment has been minimized.

Show comment
Hide comment
@mmerickel

mmerickel Sep 19, 2013

Member

Should the headers be sorted at all by waitress?

Member

mmerickel commented Sep 19, 2013

Should the headers be sorted at all by waitress?

@domruf

This comment has been minimized.

Show comment
Hide comment
@domruf

domruf Sep 19, 2013

Contributor

I don't know if there are any cases where the key order matters.
I guess it is easier to read when debugging.

Contributor

domruf commented Sep 19, 2013

I don't know if there are any cases where the key order matters.
I guess it is easier to read when debugging.

@agroszer

This comment has been minimized.

Show comment
Hide comment
@agroszer

agroszer Sep 20, 2013

Contributor

Testing comes to mind, when output matters

Contributor

agroszer commented Sep 20, 2013

Testing comes to mind, when output matters

@domruf

This comment has been minimized.

Show comment
Hide comment
@domruf

domruf Sep 20, 2013

Contributor

I found another place that manipulates the headers.
This time not only the order of the headers but the content.
In line 200 The headers get "capitalized".
But one of my clients seems to ignore Authenticate headers like 'Www-Authenticate' and only reads headers like 'WWW-Authenticate'

Contributor

domruf commented Sep 20, 2013

I found another place that manipulates the headers.
This time not only the order of the headers but the content.
In line 200 The headers get "capitalized".
But one of my clients seems to ignore Authenticate headers like 'Www-Authenticate' and only reads headers like 'WWW-Authenticate'

@domruf

This comment has been minimized.

Show comment
Hide comment
@domruf

domruf Sep 20, 2013

Contributor

OK, I found the according text in the RFC.

http://www.ietf.org/rfc/rfc2616.txt (4.2) says

"...The order in which header fields with the same field-name are received is therefore significant to the interpretation of the combined field value, and thus a proxy MUST NOT change the order of these field values when a message is forwarded..."

It also says

"Field names are case-insensitive"

So why would waitress capitalize the header names?

Contributor

domruf commented Sep 20, 2013

OK, I found the according text in the RFC.

http://www.ietf.org/rfc/rfc2616.txt (4.2) says

"...The order in which header fields with the same field-name are received is therefore significant to the interpretation of the combined field value, and thus a proxy MUST NOT change the order of these field values when a message is forwarded..."

It also says

"Field names are case-insensitive"

So why would waitress capitalize the header names?

@mcdonc

This comment has been minimized.

Show comment
Hide comment
@mcdonc

mcdonc Nov 21, 2013

Member

For what it's worth, I think you've misinterpreted the RFC section you quote. The section you quote deals with headers that have the same name, not headers that have different names. Regarding headers that have different names the spec says " The order in which header fields with differing field names are received is not significant."

Member

mcdonc commented Nov 21, 2013

For what it's worth, I think you've misinterpreted the RFC section you quote. The section you quote deals with headers that have the same name, not headers that have different names. Regarding headers that have different names the spec says " The order in which header fields with differing field names are received is not significant."

@mcdonc

This comment has been minimized.

Show comment
Hide comment
@mcdonc

mcdonc Nov 21, 2013

Member

Nope, nevermind, I misinterpreted your bug report and the test case you provided.

Member

mcdonc commented Nov 21, 2013

Nope, nevermind, I misinterpreted your bug report and the test case you provided.

@mcdonc mcdonc merged commit e9ca506 into Pylons:master Nov 21, 2013

@mcdonc

This comment has been minimized.

Show comment
Hide comment
@mcdonc

mcdonc Nov 21, 2013

Member

Thank you, this has been merged to master.

Member

mcdonc commented Nov 21, 2013

Thank you, this has been merged to master.

@mcdonc

This comment has been minimized.

Show comment
Hide comment
@mcdonc

mcdonc Nov 30, 2013

Member

Waitress 0.8.8 is out with this fix.

Member

mcdonc commented Nov 30, 2013

Waitress 0.8.8 is out with this fix.

@domruf

This comment has been minimized.

Show comment
Hide comment
@domruf

domruf Dec 2, 2013

Contributor

great thanks

Contributor

domruf commented Dec 2, 2013

great thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment