amp-library icon indicating copy to clipboard operation
amp-library copied to clipboard

fix issue #242 Malformed URL validator for attribute 'href' in tag A

Open iransamaneh opened this issue 6 years ago • 4 comments

add host check to detect malformed urls supporting ipv6, ipv4 and normal url

iransamaneh avatar Sep 22 '18 06:09 iransamaneh

it's error is on tests/test-data/full-html/incorrect_custom_style.html url and there is not any relation between my changes and this error.

please accept and done my pull request. i changed related test files to my changes with.html and .html.out files extension

iransamaneh avatar Sep 22 '18 06:09 iransamaneh

Error Details

There was 1 failure:

  1. AmpTest::testFiles with data set "tests/test-data/full-html/incorrect_custom_style.html" ('tests/test-data/full-html/inc...e.html', true) Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@

iransamaneh avatar Sep 22 '18 06:09 iransamaneh

Hi. anybody there!

iransamaneh avatar Oct 03 '18 10:10 iransamaneh

If you look at the Travis build you can see that the change broke some tests. One test that broke is an example that uses https://ad as the url in the sample, which wasn't intended to be a test for a valid url. The test would need to be updated.

Also the crazy regex looks pretty daunting. I wouldn't want to add that in without a bunch of tests that it correctly handles all kinds of urls to be sure it isn't going to create havoc on sites that work fine now.

karens avatar Jun 26 '20 00:06 karens