stevenvachon / broken-link-checker

Find broken links, missing images, etc within your HTML.
MIT License
1.97k stars 305 forks source link

URLs with double slashes work - failing test included. #132

Open AndrewCreer opened 6 years ago

AndrewCreer commented 6 years ago

Failing test

diff --git a/test/helpers/json/linkObj.json b/test/helpers/json/linkObj.json
index 3a82a62..7dead9c 100644
--- a/test/helpers/json/linkObj.json
+++ b/test/helpers/json/linkObj.json
@@ -1,4 +1,8 @@
 {
+   "URLS with double slash are valid in chrome": {
+       "linkUrl": "https://s3-api.us-geo.objectstorage.softlayer.net/ndis-products-production//app/public/spree/sellers/logos/15/standard/Aidacare-Logo-1500x410.jpg?1527830678",
+       "resolvedLinkUrl": "{{linkUrl}}"
+   },
    "REMOTE ABSOLUTE url with a REMOTE ABSOLUTE base and REMOTE ABSOLUTE html base": {
        "linkUrl": "https://fakeurl2.com/path/link.html?query#hash",
        "baseUrl": "https://fakeurl2.com/path/link.html?query#hash",
stevenvachon commented 6 years ago

Have you tried the v0.8.0 branch?

AndrewCreer commented 6 years ago

On 26/10/18 11:53 pm, Steven Vachon wrote:

Have you tried the v0.8.0 branch?

Yes

diff --git a/test/helpers/json/Link.json b/test/helpers/json/Link.json index 0c72963..c422a91 100644 --- a/test/helpers/json/Link.json +++ b/test/helpers/json/Link.json @@ -1,4 +1,9 @@ { +

results in

  1) INTERNAL -- Link

       .resolve()

         accepts URLS with double slash are valid in chrome:

     TypeError [ERR_INVALID_URL]: Invalid URL: undefined

      at onParseError (internal/url.js:219:17)

      at parse (internal/url.js:228:3)

      at new URL (internal/url.js:311:5)

      at expectInterpolated (test/0.internal.Link.js:215:14)

      at Context. (test/0.internal.Link.js:250:5)

I agree it is an invalid url, but if chrome is going to find resources there, then well I guess it is valid

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stevenvachon/broken-link-checker/issues/132#issuecomment-433397173, or mute the thread https://github.com/notifications/unsubscribe-auth/ANiQ0IHFf9Vg86i5HPMEmiZze0hbUzHaks5uowWxgaJpZM4X7bhJ.

stevenvachon commented 3 years ago

@AndrewCreer it shouldn't have thrown invalid URL error as it's not an invalid URL. I think you may have configured the json file incorrectly