Skip to content
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

Method case sensitivity #1

Closed
mnot opened this issue Aug 6, 2014 · 12 comments
Closed

Method case sensitivity #1

mnot opened this issue Aug 6, 2014 · 12 comments

Comments

@mnot
Copy link
Member

mnot commented Aug 6, 2014

HTTP defines methods as case-insensitive, but many implementations / apps built on HTTP case-normalise to uppercase.

I don't remember discussing this on the list, and a quick search of the issues list doesn't show anything.

See also w3c/ServiceWorker#120.

@reschke
Copy link
Contributor

reschke commented Apr 20, 2015

What application except browsers are known to do this?

EDIT: as far as I can tell, browser do not case-normalize in XHR. So what is this issue about? Did they start doing so with FETCH?

@mnot mnot added the semantics label Jun 20, 2017
@mnot
Copy link
Member Author

mnot commented Mar 24, 2018

https://fetch.spec.whatwg.org/#methods --

To normalize a method, if it is a byte-case-insensitive match for DELETE, GET, HEAD, OPTIONS, POST, or PUT, byte-uppercase it.

So they have limited case-insensitivity for certain methods.

IIRC I have seen this commonly in browsers, but I don't see a test in WPT (@annevk?). Julian, your test doesn't cover it either.

Given that the Fetch requirement effectively means that these methods are only ever uppercase on the wire, I don't think we have an interop problem; the only issue is that someone who (very foolishly, IMO) uses a case variant of one of these methods is going to be disappointed.

Could of things we could do here (not exclusive):

  1. Tell IANA not to register methods that only vary in case from existing ones
  2. Advise / require clients to case-normalise these (and only these) methods
  3. Restrict methods to uppercase

@royfielding
Copy link
Member

royfielding commented Mar 24, 2018 via email

@annevk
Copy link
Contributor

annevk commented Mar 24, 2018

It's not really related to HTML forms. It's just a bad client-side implementation that content came to rely on. Here's some method tests:

@annevk
Copy link
Contributor

annevk commented Mar 24, 2018

(I've often wondered whether we should offer a way to make get, Get, etc. requests, but I'm a little worried there might be security implications of sorts at this point and the benefit seems rather questionable. In a way it's similar to browsers not supporting a request body for GET.)

@mnot
Copy link
Member Author

mnot commented Jun 5, 2018

Given that registration requires IETF consensus, it seems pretty unlikely we'd register a method that differs in case alone, so I tend to agree we don't need to limit IANA.

Is it worthwhile to note that some implementations case-normalise some methods?

@annevk
Copy link
Contributor

annevk commented Jun 5, 2018

Given

The method token is case-sensitive because it might be used as a gateway to object-based systems with case-sensitive method names.

I think so, as get is a pretty common method name.

I also find potential for confusion in

By convention, standardized methods are defined in all-uppercase US-ASCII letters.

as it could suggest they are not case-sensitive if you do not read carefully and no such convention is stated for other syntax aspects, such as header fields, despite there clearly being one.

@reschke
Copy link
Contributor

reschke commented Jun 29, 2018

FWIW, I added a test at http://test.greenbytes.de/tech/tc/httpredirects/t301methods.html which tests "lowerCase".

@mnot
Copy link
Member Author

mnot commented Oct 10, 2018

Perhaps if we moved the "By convention..." sentence up two paragraphs, after it's explained that they are case-sensitive?

@reschke
Copy link
Contributor

reschke commented Oct 10, 2018

Works for me.

@royfielding
Copy link
Member

+1 on moving it up.

@mnot mnot closed this as completed in 727160a Oct 15, 2018
@mnot mnot removed the has-proposal label Oct 15, 2018
@mnot
Copy link
Member Author

mnot commented Oct 15, 2018

Done. I haven't listed in change notes as this is just editorial; please yell if that causes discomfort.

I also broke the paragraph out, since that one was getting big, in ad9a322.

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

No branches or pull requests

4 participants