Rename internal asset path to /_gw/ to avoid collision with user apps
This commit is contained in:
@@ -76,9 +76,8 @@ func (tm *TunnelManager) FindSlugByConn(conn *gossh.ServerConn) (string, bool) {
|
||||
// HTTP Proxy to forward requests to the SSH tunnel
|
||||
func startHttpProxy(port string) {
|
||||
log.Printf("Starting HTTP Proxy on %s", port)
|
||||
// Serve static files for 404 page
|
||||
|
||||
http.Handle("/assets/", http.StripPrefix("/assets/", http.FileServer(http.Dir("./cmd/server/static/assets"))))
|
||||
// Serve static files for 404 page (namespaced to avoid collision with user apps)
|
||||
http.Handle("/_gw/", http.StripPrefix("/_gw/", http.FileServer(http.Dir("./cmd/server/static/assets"))))
|
||||
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
// Extract subdomain to identify the tunnel
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
<link
|
||||
rel="stylesheet"
|
||||
id="a3a3_lazy_load-css"
|
||||
href="./assets/a3_lazy_load.min.css"
|
||||
href="/_gw/a3_lazy_load.min.css"
|
||||
type="text/css"
|
||||
media="all"
|
||||
/>
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
<link rel="stylesheet" href="/_gw/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<section class="error_404">
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
<!-- Astronaut -->
|
||||
<div class="error_404_astro">
|
||||
<object data="assets/astro.svg"></object>
|
||||
<object data="/_gw/astro.svg"></object>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user