yahoo / TDOAuth

A BSD-licensed single-header-single-source OAuth1 implementation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Params for DELETE & HEAD requests should be handled like GET

adamkaplan opened this issue · comments

commented

HTTP spec forbids an entity for HEAD requests, so specified parameters should be appended to URL (as with GET).

Older specs also seemed to not want entity in DELETE requests either. Newer RFC do allow these, however the more compatible path forward is to put them in the URL

If nobody has a problem treating HEAD & DELETE parameters like GET, I'll make a pull request to fix this.

http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-19#section-6.7

Do you have a situation where putting the data in the entity for HEAD or DELETE is causing problems?

I'd rather not fix things without being able to verify the fix.

commented

Hey @mcxl, thanks for responding. I certainly have a case where this is a problem. We recently switched to TDOAuth+NSURLSession over AFNetworking-based OAuth in the Yahoo Finance app, and life has been much simpler :)

We use a REST-ish DELETE endpoint which expects a user token as a URL parameter. I debated whether to file a ticket for the API or for TDOAuth. There is no correct answer, but I figure that DELETE should not have a significant payload, so it's less wrong to support URL parameters over the existing HTTP entity payload.

I don't have a critical need for changing HEAD to use URL parameters. However, that one is a definite bug as it is explicitly forbidden to send along an entity.

I have a 1 line PR fix for this. Just need to add test cases and I can push it later today.

Great, sounds good. Look forward to it.

commented

There you go! 🌻