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

Should we treat + as %20 in uri query part? #51

Open
paluh opened this issue Nov 18, 2017 · 3 comments
Open

Should we treat + as %20 in uri query part? #51

paluh opened this issue Nov 18, 2017 · 3 comments

Comments

@paluh
Copy link
Collaborator

paluh commented Nov 18, 2017

I've described details here: purescript-contrib/purescript-uri#38

@owickstrom
Copy link
Collaborator

owickstrom commented Nov 20, 2017

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?

@paluh
Copy link
Collaborator Author

paluh commented Nov 20, 2017

@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: purescript-contrib/purescript-uri#38 (comment)

@paluh
Copy link
Collaborator Author

paluh commented May 31, 2018

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?

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

No branches or pull requests

2 participants