Fix relative paths (#4594)
* Add tests for relativeRoot * Remove path.posix.join Since this is for file system paths it feels incorrect to use it on URL paths as they are different in many ways. * Rewrite cookie path logic Before we relied on the client to resolve the base given to it by the backend against the path. Instead have the client pass that information along so we can resolve it on the backend. This means the client has to do less work. * Do not remove out directory before watch This is re-used for incremental compilation. Also remove del since that was the only use (and we can use fs.rmdir in the future if we need something like this). * Remove unused function resolveBase
This commit is contained in:
@ -30,7 +30,8 @@
|
||||
<div class="content">
|
||||
<form class="login-form" method="post">
|
||||
<input class="user" type="text" autocomplete="username" />
|
||||
<input id="base" type="hidden" name="base" value="/" />
|
||||
<input id="base" type="hidden" name="base" value="{{BASE}}" />
|
||||
<input id="href" type="hidden" name="href" value="" />
|
||||
<div class="field">
|
||||
<input
|
||||
required
|
||||
@ -51,9 +52,9 @@
|
||||
<script>
|
||||
// Inform the backend about the path since the proxy might have rewritten
|
||||
// it out of the headers and cookies must be set with absolute paths.
|
||||
const el = document.getElementById("base")
|
||||
const el = document.getElementById("href")
|
||||
if (el) {
|
||||
el.value = window.location.pathname
|
||||
el.value = location.href
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
Reference in New Issue
Block a user