-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix(parseQueryString): do not remove '+' from query #31
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could update your PR such that the tests I added in the comments pass, we could pull that as a non-breaking change.
@@ -226,7 +226,7 @@ export function parseQueryString(queryString: string): Object { | |||
query = query.substr(1); | |||
} | |||
|
|||
let pairs = query.replace(/\+/g, ' ').split('&'); | |||
let pairs = query.split('&'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wouldn't yield the desired behavior. + literals are spaces.
@@ -272,5 +272,7 @@ describe('query strings', () => { | |||
expect(parse('a[b][c][d]=e')).toEqual({a: {b: {c: {d: 'e'}}}}); | |||
expect(parse('a[b][]=c&a[b][]=d&a[b][2][]=f&a[b][2][]=g')).toEqual({a: {b: ['c','d', ['f', 'g']]}}); | |||
expect(parse('a[0]=b')).toEqual({a: ['b']}); | |||
|
|||
expect(parse('a=b+c')).toEqual({a: 'b+c'}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(parse('a=b+c')).toEqual({a: 'b c'});
expect(parse('a=b%2Bc')).toEqual({a: 'b+c'});
I would pull if these tests pass. Fair?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first line is exactly what I was trying to fix. If I pass %2B in a parameter it gets decoded in aurelia-browser-history and arrives as a '+', which is then replaced
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to close the PR if aurelia-browser-history gets fixed. As of now, this is a pretty serious bug which prevents using Asp.net Identity completely
Closing as not working as the standard |
fixes #30