Fix a session path for NotFoundHandler

pull/25/head
Vasile Popescu 4 years ago committed by Elis Popescu
parent 150e5932d3
commit 69c544e993

@ -96,12 +96,12 @@ func _404Css() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "404.css", size: 3393, mode: os.FileMode(420), modTime: time.Unix(1601847850, 0)}
info := bindataFileInfo{name: "404.css", size: 3393, mode: os.FileMode(420), modTime: time.Unix(1604508925, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var __404InHtml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x92\x31\x6f\xdc\x30\x0c\x85\x77\xff\x0a\x46\x4b\x27\x1d\x6f\xf0\x14\xc8\x5a\xda\xce\x3d\xa0\x59\x3a\xea\x64\xda\x12\x22\x4b\x82\xc8\x26\x39\x04\xf9\xef\x85\xed\x0c\xb9\xdc\xd0\x4c\x02\xde\xfb\xf0\xf4\x40\xd2\xdc\x69\x0d\x0f\x21\x32\x44\x06\x71\x8f\x94\x61\x6a\x65\xb9\x87\x20\x52\xf9\x1e\xd1\x97\x54\x5a\x8a\xe7\x83\x2f\x0b\x3e\x57\x9c\x1a\x91\xee\x8f\xbd\xa6\xd6\x4a\xd3\xd5\xcd\xa4\x85\x96\x9a\x9c\x10\x23\x68\x6d\x3b\x73\xf7\xe3\xd7\xf7\x87\x3f\xa7\x9f\x10\x64\x49\xb6\xeb\xcc\xfa\x42\x72\x79\x1e\x14\x65\x65\x3b\x13\xc8\x8d\xb6\x03\x00\x30\x29\xe6\x47\x68\x94\x06\xc5\x72\x49\xc4\x81\x48\x14\xc8\xa5\xd2\xa0\x84\x5e\x04\x3d\xb3\x82\xd0\x68\x1a\x14\xbe\xbe\x1e\x4e\x4e\xc2\xa9\xd1\x14\x5f\xde\xde\x90\xc5\x49\xf4\xd8\x1f\xfb\xc3\x8a\xd9\xce\xe0\x1e\x6d\xce\x65\xbc\xbc\xff\xc0\xe4\x25\x96\x0c\x71\x1c\x54\x2e\xa2\xa7\xf2\x37\x8f\x6a\x37\x37\x60\x8c\x4f\x9b\x29\x51\x12\x29\xfb\xbb\x2c\x24\x21\xe6\xf9\x1b\xc3\x73\x2b\x79\x36\x38\xc6\xa7\x4f\xbc\x4f\x8e\x79\x50\x3e\x36\x9f\x88\x3f\xa4\x6d\x44\xb5\xfd\xb1\xbf\x92\x36\xf9\xdc\xec\xad\xc8\x8b\x4b\xc9\x9e\xdc\x4c\x90\x8b\xc0\xd6\xce\xe0\xae\x5e\xa7\x62\xfd\x24\x70\x75\xf9\xba\x09\x9c\xe3\xac\xac\xc1\xd5\xf9\x3f\xbc\xd0\xf8\x75\x78\x6b\x74\x8b\x7f\x18\x8e\xc1\xf7\x51\xaf\x7b\xd8\x17\x60\x70\xbf\x81\x7f\x01\x00\x00\xff\xff\x44\xad\x28\xcd\x68\x02\x00\x00")
var __404InHtml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x92\xbd\x6e\xdc\x30\x10\x84\x7b\x3d\xc5\x9a\x4d\x2a\x1e\xaf\x50\x65\x50\x6c\x92\xd4\x11\x10\x37\x29\x29\x6a\x25\x12\xa6\x48\x82\xbb\xb1\x7d\x30\xee\xdd\x03\x49\x57\xdc\x4f\x11\x57\x04\x66\x3e\x0c\x07\xbb\xab\x9f\xa4\x84\x17\x1f\x08\x02\x01\xdb\x57\x4c\x30\xd5\xbc\x3c\x83\x67\x2e\xf4\xac\x94\xcb\x31\xd7\x18\x86\x83\xcb\x8b\x7a\x2f\x6a\xaa\x88\xb2\x3d\xb6\x12\x6b\xcd\x55\x16\x3b\xa3\x64\x5c\x4a\xb4\x8c\xa4\x40\x4a\xd3\xe8\xa7\x1f\xbf\xbe\xbf\xfc\xe9\x7f\x82\xe7\x25\x9a\xa6\xd1\xeb\x0b\xd1\xa6\xb9\x13\x98\x84\x69\xb4\x47\x3b\x9a\x06\x00\x40\xc7\x90\x5e\xa1\x62\xec\x04\xf1\x29\x22\x79\x44\x16\xc0\xa7\x82\x9d\x60\xfc\x60\xe5\x88\x04\xf8\x8a\x53\x27\x3e\x3f\x0f\xbd\x65\xdf\x57\x9c\xc2\xc7\xf9\xac\x88\x2d\x07\xa7\xda\x63\x7b\x58\x29\xd3\x68\xb5\x27\xeb\x21\x8f\xa7\xcb\x07\x84\x8e\x43\x4e\x10\xc6\x4e\xa4\xcc\x72\xca\x7f\xd3\x28\x76\x73\x03\xc6\xf0\xb6\x99\x1c\x38\xa2\x30\xbf\xf3\x82\xec\x43\x9a\xbf\x11\xbc\xd7\x9c\x66\xad\xc6\xf0\x76\xc7\xbb\x68\x89\x3a\xe1\x42\x75\x11\xe9\x2a\x6d\x23\x8a\x69\x8f\xed\x8d\xb4\xc9\x43\x35\x8f\x22\x2d\x36\x46\xd3\xdb\x19\x21\x65\x86\xad\x9d\x56\xbb\x7a\x9b\xaa\xca\x9d\x40\xc5\xa6\xdb\x26\x30\x84\x59\x18\xad\x56\xe7\xff\xf0\x82\xe3\xd7\xe1\xad\xd1\x23\x7e\x35\x1c\xad\x2e\xa3\x5e\xf7\xb0\x2f\x40\xab\xfd\x04\xfe\x05\x00\x00\xff\xff\xd7\xd8\xd0\xdf\x67\x02\x00\x00")
func _404InHtmlBytes() ([]byte, error) {
return bindataRead(
@ -116,7 +116,7 @@ func _404InHtml() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "404.in.html", size: 616, mode: os.FileMode(420), modTime: time.Unix(1601847850, 0)}
info := bindataFileInfo{name: "404.in.html", size: 615, mode: os.FileMode(420), modTime: time.Unix(1604508925, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@ -136,7 +136,7 @@ func bootstrapMinCss() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "bootstrap.min.css", size: 140930, mode: os.FileMode(420), modTime: time.Unix(1601847850, 0)}
info := bindataFileInfo{name: "bootstrap.min.css", size: 140930, mode: os.FileMode(420), modTime: time.Unix(1604508925, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@ -156,7 +156,7 @@ func ttyShareInHtml() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "tty-share.in.html", size: 424, mode: os.FileMode(420), modTime: time.Unix(1601847850, 0)}
info := bindataFileInfo{name: "tty-share.in.html", size: 424, mode: os.FileMode(420), modTime: time.Unix(1604508925, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@ -176,7 +176,7 @@ func ttyShareJs() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "tty-share.js", size: 404671, mode: os.FileMode(420), modTime: time.Unix(1601847850, 0)}
info := bindataFileInfo{name: "tty-share.js", size: 404671, mode: os.FileMode(420), modTime: time.Unix(1604508925, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}

@ -3,7 +3,7 @@
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="/{{.PathPrefix}}/static/404.css">
<link rel="stylesheet" type="text/css" href="{{.PathPrefix}}/static/404.css">
</head>
<body>
<section id="not-found">

@ -88,6 +88,8 @@ func NewTTYServer(config TTYServerConfig) (server *TTYServer) {
routesHandler := mux.NewRouter()
installHandlers := func(session string) {
// This function installs handlers for paths that contain the "session" passed as a
// parameter. The paths are for the static files, websockets, and other.
path := fmt.Sprintf("/s/%s/static/", session)
routesHandler.PathPrefix(path).Handler(http.StripPrefix(path,
http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@ -113,7 +115,7 @@ func NewTTYServer(config TTYServerConfig) (server *TTYServer) {
server.handleWebsocket(w, r)
})
routesHandler.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
templateModel := struct{ PathPrefix string }{session}
templateModel := struct{ PathPrefix string }{fmt.Sprintf("/s/%s", session)}
server.handleWithTemplateHtml(w, r, "404.in.html", templateModel)
})
}

Loading…
Cancel
Save