[openstreetmap/openstreetmap-website] Allow `user/preferences/[KEY]` to accept arbitrary keys (PR #3787)

Taylor Smock notifications at github.com
Wed Nov 16 21:56:30 UTC 2022


> Can the dots in the key be url encoded? E.g. /user/preference/foo%2Ebar.xml for the key foo.bar?

Technically, yes. `%2E` is `.`. See [RFC3986](https://www.ietf.org/rfc/rfc3986.txt) section 2.1 for details (_all_ ASCII characters can be URL encoded, syntax is `%<char hex>`)

Unfortunately, _most_ common URL encoders that people use _will not_ encode `.` by default.

* [JavaScript encodeURI](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI)
* [Java URLEncoder](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/URLEncoder.html)
In either case, doing a string replace of "." with "%2E" will fix the problem, but we would want to document that users _must_ do so.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3787#issuecomment-1317722848
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/3787/c1317722848 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20221116/7769e19c/attachment.htm>


More information about the rails-dev mailing list