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

fix(parseQueryString): do not remove '+' from query #31

Closed
wants to merge 1 commit into from
Closed

fix(parseQueryString): do not remove '+' from query #31

wants to merge 1 commit into from

Conversation

MaximBalaganskiy
Copy link

fixes #30

@CLAassistant
Copy link

CLAassistant commented May 7, 2019

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@davismj davismj left a 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('&');
Copy link
Member

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'});
Copy link
Member

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?

Copy link
Author

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

Copy link
Author

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

@MaximBalaganskiy
Copy link
Author

Closing as not working as the standard

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

Successfully merging this pull request may close these issues.

Pluses get replaced with spaces
3 participants