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

Parse "[]&y=1" returns empty string #75

Open
eugene-piatenko opened this issue Aug 29, 2013 · 5 comments
Open

Parse "[]&y=1" returns empty string #75

eugene-piatenko opened this issue Aug 29, 2013 · 5 comments
Labels

Comments

@eugene-piatenko
Copy link

Parsing x[]&y=1 returns

{
  "x": [],
  "y": "1"
}

but parsing []&y=1 returns "" (empty string)

@buschtoens
Copy link
Collaborator

Besides that this is an illegal qs anyhow, it would be fixed by altering the parser.

I was thinking of a RegExp based parser.

@tj
Copy link
Owner

tj commented Dec 5, 2013

@eugene-piatenko why would you expect anything useful out of that query-string?

@buschtoens
Copy link
Collaborator

We could at least hope for { 'y': '1' }.

@tj
Copy link
Owner

tj commented Dec 5, 2013

i sort of feel like a lot of these requests to support broken query strings are akin to sending broken json, it's just broken, it's a client error, though unfortunately since there's no spec we don't have the luxury of enforcing that haha

@buschtoens
Copy link
Collaborator

Haha, yeah. I would have loved the W3C to do some more work on URLs, specifically querystrings, as their importance is growing in today's web apps. But then again, vendors take years to implement those specs.

@eugene-piatenko I will try to come up with a more forgiving parser in #88. In the meanwhile you're welcome to submit a PR. :)

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

No branches or pull requests

3 participants