happy-dom
happy-dom copied to clipboard
error in method getAbsoluteURL
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.
~~An imperfect solution.~~
~~https://github.com/Mas0nShi/happy-dom/commit/3e676057275d67fa4c944d5d68e204015480522b~~
we use native module url
fix it #521