martasp / BlazorLiveReload

BlazorLiveReload
143 stars 14 forks source link

Preview.html is generated with leading slash for external links #15

Open JanVargovsky opened 4 years ago

JanVargovsky commented 4 years ago

I've created default templated and added Blazorise, so my _Host.cshtml consist of following:

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">

generated preview.html looks like this:

<link rel="stylesheet" href="/https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="/https://use.fontawesome.com/releases/v5.12.0/css/all.css">

which causes problem that it tries to download the resource from my server.

Workaround is to fix it once (remove leading slashes) and browser keeps the loaded css files, so even if the following reload wont load them its still alive on the page and css just works.