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

redirect when using window.location #172

Closed
knownun opened this issue Apr 12, 2019 · 1 comment
Closed

redirect when using window.location #172

knownun opened this issue Apr 12, 2019 · 1 comment

Comments

@knownun
Copy link
Contributor

@knownun knownun commented Apr 12, 2019

Hello, enjoying your library, it's very helpful.

But with the recent update, if you accidentally do this

new UrlParse(window.location)

UrlParse redirect page to this path
%5E[/x09/x0A/x0B/x0C/x0D/x20/xA0/u1680/u180E/u2000/u2001/u2002/u2003/u2004/u2005/u2006/u2007/u2008/u2009/u200A/u202F/u205F/u3000/u2028/u2029/uFEFF]+/

That happens because of
image
image

In case str is a location Object

would be really helpful if you can add some kind of error, or cast address to a string

function Url(address, location, parser) {
  address = trimLeft(`${address}`);
function Url(address, location, parser) {
  address = trimLeft(address.toString());
function Url(address, location, parser) {
  if (typeof address !== 'string') {
    throw new Error('some text here');
  }
  address = trimLeft(address);
@lpinca
Copy link
Member

@lpinca lpinca commented Apr 12, 2019

I'm closing this as it should be fixed in the latest version.

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

No branches or pull requests

2 participants