ring-clojure / ring-codec

Utility library for encoding and decoding data
MIT License
63 stars 30 forks source link

Support other query string param delimiters, ie: `;` #14

Closed tomascasas closed 8 years ago

tomascasas commented 8 years ago

I am relying ring.util.codec/form-decode to parse url query strings.

Today I received for the 1st time a url that has ; as parameter delimiter instead of &. It also seem to be supported and encouraged by the standard. http://stackoverflow.com/questions/642758/delimiter-to-use-within-a-query-string-value http://stackoverflow.com/questions/3481664/semicolon-as-url-query-separator

Specially the latter pointing to: https://www.w3.org/TR/html401/appendix/notes.html#h-B.2.2

https://github.com/ring-clojure/ring-codec/blob/master/src/ring/util/codec.clj#L131

weavejester commented 8 years ago

The section in the HTML4 specification relating to that seems to be omitted from the HTML5 specification, indicating that the use of semicolons as alternative delimiters is deprecated. I think I'd accept support for semicolons as an option, but as their use is rare (I've never come across this before!) and is likely going to be rarer in future, I don't think it should be supported by default.

tomascasas commented 8 years ago

Sounds fair. Thanks.