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

anchorme.validate.url crash app with unencoded uri. #82

Open
nricca opened this issue Jun 2, 2020 · 2 comments · May be fixed by #150
Open

anchorme.validate.url crash app with unencoded uri. #82

nricca opened this issue Jun 2, 2020 · 2 comments · May be fixed by #150

Comments

@nricca
Copy link

nricca commented Jun 2, 2020

Hi,

I've an angular app that use anchrome lib for url validation at some point.
With some urls, the app crash !

Test it with this url =>
https://pages.getpostman.com/rs/067-UMD-991/images/ban-api-builder (1).jpg

I had to add an encodeURI in order to use the validation without issue.

The lib should encode uri or at least do not make the app crash.

Best regards 👋🏻

@mattrussell-sonocent
Copy link

mattrussell-sonocent commented Aug 18, 2021

We hit this in our app. Some URLs cause the browser tab to hit 100% CPU and never complete validation, e.g.
https://en.wikipedia.org/wiki/Robert_Cranston_(Scottish_politician)

Some URLs do validate, just very slowly, e.g.
https://en.wikipedia.org/wiki/Robert_Cranston(abcdefg) takes a minute or so.

Some shorter URLs take less time, e.g.
https://en.wikipedia.org/wiki/Robert_Cranston(a)

(This is in Chrome).

Is the recommendation that we ought to be URL encoding before calling anchorme.validate.url?

@mdr
Copy link

mdr commented Aug 18, 2021

Codepen with some timings: https://codepen.io/mattrussell-glean/pen/jOmjBmJ

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 a pull request may close this issue.

4 participants