Skip to content

Replace parseurl with WHATWG URL API #315

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Saturate
Copy link

More information here:

e18e/ecosystem-issues#160

@Saturate Saturate changed the title chore: Replace parseurl with WHATWG URL API Replace parseurl with WHATWG URL API Feb 19, 2025
Copy link

Stale pull request message

@eugef eugef requested a review from Copilot April 27, 2025 01:39
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the use of the deprecated parseurl package with the WHATWG URL API to obtain the pathname from the request object.

  • Removed dependency on parseurl
  • Updated logic for retrieving the request pathname using the WHATWG URL API
Files not reviewed (1)
  • package.json: Language not supported

@@ -119,7 +118,7 @@ defineGetter(req, 'subdomains', function subdomains() {
});

defineGetter(req, 'path', function path() {
return parse(this).pathname;
return new URL(this).pathname;
Copy link
Preview

Copilot AI Apr 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'new URL(this)' may throw an error if 'this' does not contain an absolute URL. Consider providing a valid absolute URL string or a base URL as the second parameter to ensure proper parsing.

Suggested change
return new URL(this).pathname;
const baseUrl = `${this.protocol || 'http'}://${this.host || 'localhost'}`;
return new URL(this.url, baseUrl).pathname;

Copilot uses AI. Check for mistakes.

Copy link

Stale pull request message

@Saturate
Copy link
Author

Stale pull request message

Hmm, ok? :)

@github-actions github-actions bot closed this Jul 5, 2025
@eugef eugef reopened this Jul 7, 2025
@github-actions github-actions bot closed this Jul 15, 2025
@eugef eugef reopened this Jul 15, 2025
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 this pull request may close these issues.

2 participants