Skip to content

Commit

Permalink
fix(ilc): bring back comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wRLSS committed Oct 4, 2024
1 parent d306208 commit 7bb93fb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ilc/common/UrlProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ class UrlProcessor {

#processUrlTrailingSlash = (url) => {
if (!UrlProcessor.validSchemes.some((scheme) => url.startsWith(scheme))) {
// any combination of slashes at the beginning URL class classifies as an absolute link with http: protocol, so we remove them at the end
url = url.replace(/^[\/\\]+/gi, '/');
}

const parsedUrl = new URL(url, this.#fakeBaseInCasesWhereUrlIsRelative);

// Ensure there are no double slashes in the pathname, excluding the start
parsedUrl.pathname = parsedUrl.pathname.replace(/\/{2,}/g, '/');

const doesUrlPathnameEndWithTrailingSlash = parsedUrl.pathname[parsedUrl.pathname.length - 1] === '/';
Expand Down

0 comments on commit 7bb93fb

Please sign in to comment.