-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Problem
Some issues on this repo are saying that more decoding should happen on path segments by default:
- Url.Parser.string does not decode the value #16
- s should call percentDecode before matching segment #20
- path should also be escaped #25
- Use percentEncode on path segments in Url.Builder #41
Issue #20 also says that this decoding should not occur in all cases, referencing this issue that points to implementations in many languages that do not call percentDecode in a naive way.
What should be done?
Current Status
As mentioned in #16, it is currently possible to use Url.Parser.custom to create custom path parsers that have whatever behavior you personally think is best. For example, custom "STRING" Url.percentDecode would do very aggressive percent decoding.
So nobody is blocked on this topic. It is a question of defaults, and any change should be considered a breaking change that triggers a MAJOR version bump.
Goal
Make a table of scenarios to try to find the ideal defaults for a broad range of people. The default options for path parsing and building are:
- no percent decoding
- percent decoding for specific characters
- percent decoding for all characters
We currently do (1) but maybe it'd be good to make a table to show the various options. Right now I think it would be ideal for someone interested in this topic to:
- Build a table of interesting paths and see how they all work under different defaults.
- Check the defaults of implementations in other languages.
Hopefully this will reveal more information / some sort of consensus. I think being thorough about this is very important, since any change here could break a lot of peoples' code in ways that might be very hard to detect. Please share your efforts here or on the Elm Discourse.