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
|
// HTTP Proxy to forward requests to the SSH tunnel
|
||||||
func startHttpProxy(port string) {
|
func startHttpProxy(port string) {
|
||||||
log.Printf("Starting HTTP Proxy on %s", port)
|
log.Printf("Starting HTTP Proxy on %s", port)
|
||||||
// Serve static files for 404 page
|
// 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.Handle("/assets/", http.StripPrefix("/assets/", http.FileServer(http.Dir("./cmd/server/static/assets"))))
|
|
||||||
|
|
||||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
// Extract subdomain to identify the tunnel
|
// Extract subdomain to identify the tunnel
|
||||||
|
|||||||
@@ -16,11 +16,11 @@
|
|||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
id="a3a3_lazy_load-css"
|
id="a3a3_lazy_load-css"
|
||||||
href="./assets/a3_lazy_load.min.css"
|
href="/_gw/a3_lazy_load.min.css"
|
||||||
type="text/css"
|
type="text/css"
|
||||||
media="all"
|
media="all"
|
||||||
/>
|
/>
|
||||||
<link rel="stylesheet" href="assets/style.css">
|
<link rel="stylesheet" href="/_gw/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<section class="error_404">
|
<section class="error_404">
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
<!-- Astronaut -->
|
<!-- Astronaut -->
|
||||||
<div class="error_404_astro">
|
<div class="error_404_astro">
|
||||||
<object data="assets/astro.svg"></object>
|
<object data="/_gw/astro.svg"></object>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user