happy-dom icon indicating copy to clipboard operation
happy-dom copied to clipboard

error in method getAbsoluteURL

Open Mas0nShi opened this issue 2 years ago • 1 comments

Associate with #508

I think this test unit is wrong, so the implementation is wrong too.

https://github.com/capricorn86/happy-dom/blob/f9d55eb1f31ee6538935d27c5173be5db11516f8/packages/happy-dom/test/location/RelativeURL.test.ts

why?

in order to load the web assets in ResourceFetchHandler.fetchSync correctly, we used RelativeURL.getAbsolteURL. but it's seems wrong!

e.g. we have tags <link rel="stylesheet" href="/static/jquery.css" type="text/css" /> in http://localhost/tree/ the correct way is http://localhost/static/jquery.css but it's http://localhost/tree/static/jquery.css now.

Mas0nShi avatar Jun 24 '22 11:06 Mas0nShi

~~An imperfect solution.~~

~~https://github.com/Mas0nShi/happy-dom/commit/3e676057275d67fa4c944d5d68e204015480522b~~

we use native module url fix it #521

Mas0nShi avatar Jun 24 '22 11:06 Mas0nShi