Open paluh opened 6 years ago
Good question. In my opinion, the purescript-uri
package would be a strange place to have this "fix", at least more so than in Hyper. That said, I'm leaning towards not supporting +
as encoded space in Hyper either, at least not by default. Not sure if it makes sense to have it configurable either... What do you think?
@owickstrom I'm not sure how to politely continue this discussion as I've opened two different tickets on the same topic :-) I can copy all related comments from purescript-uri
thread here too for completeness if you want.
Anyway, I've tested some browsers behavior and checked how other libraries are treating +
in queries. You can find results of "my research" in the latest comment here: https://github.com/slamdata/purescript-uri/issues/38#issuecomment-345710976
I think I'm going to provide
type Options = { replacePlus :: Boolean }
defaultOptions :: Options
defaultOptions = { replacePlus: true }
and change
parseUrlencoded :: Options -> String -> Either String (Array (Tuple String (Maybe String))
Does it sound good to you?
I've described details here: https://github.com/slamdata/purescript-uri/issues/38