Skip to content

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