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

URL's search missing question mark #665

Closed
HomyeeKing opened this issue Nov 23, 2022 · 3 comments
Closed

URL's search missing question mark #665

HomyeeKing opened this issue Nov 23, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@HomyeeKing
Copy link

HomyeeKing commented Nov 23, 2022

Describe the bug

URL will auto add question mark when you set the search value, which is

  const url = new URL('https://www.google.com');
  url.search = 'a=1'
console.log(url.toString()) //  https://www.google.com/?a=1

but in happy-dom environment, the ? symbol missed,the actual value is https://www.google.com/a=1

To Reproduce

I'm using vitest w/ happy-dom

clone https://github.com/HomyeeKing/vitest-repo to reproduce

Device:

  • OS: [e.g. iOS] MacOS
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22] latest 7.7.0
@HomyeeKing HomyeeKing added the bug Something isn't working label Nov 23, 2022
@Mas0nShi
Copy link
Contributor

Duplicate of #401 and more.

We fixed in #520.

@capricorn86
Copy link
Owner

capricorn86 commented Dec 7, 2022

Thanks for reporting @quantuminformation! 🙂

We have now fixed this by using the native url module.

You can read more about the release here:
https://github.com/capricorn86/happy-dom/releases/tag/v7.8.0

@quantuminformation
Copy link

quantuminformation commented Dec 26, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants