Skip to content

SR-6405: URLRequest: Implement normalization for httpMethod #1339

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

Merged
merged 1 commit into from
Nov 30, 2017

Conversation

ianpartridge
Copy link
Contributor

Darwin performs normalization of httpMethod for 6 specific HTTP methods. Match this behaviour.

@ianpartridge ianpartridge changed the title URLRequest: Implement normalization for httpMethod SR-6405: URLRequest: Implement normalization for httpMethod Nov 27, 2017
@ianpartridge
Copy link
Contributor Author

@swift-ci please test

@alblue
Copy link
Contributor

alblue commented Nov 29, 2017

I'm not particularly happy with this change, as it seems to be based on an implementation assumption that it outside of the specification of this method. Would like @phausler to opine in case there's some other assumption about behaviour here, such as whether there's a normalised cache of httpMethods.

@alblue
Copy link
Contributor

alblue commented Nov 29, 2017

NB I'm not disagreeing that this is the behaviour on Darwin - and in fact, there are several places in the code where it only works if the httpMethod is e.g. GET instead of gEt - but I'd like to try and understand what the correct behaviour should be implemented as.

@ianpartridge
Copy link
Contributor Author

This PR matches what I reverse engineered from Darwin. I'm sure there are other aspects of normalization that aren't covered here (e.g. HTTP header names) but those can wait for another day...

@alblue
Copy link
Contributor

alblue commented Nov 29, 2017

OK, having looked into the way it works on Darwin, I agree that it does do a resolution based on a routine in CFNetwork, and then uses those in place of the supplied one if it finds them. So I withdraw my objections :)

@alblue
Copy link
Contributor

alblue commented Nov 30, 2017

@swift-ci please test and merge

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.

3 participants