mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-30 06:51:30 +02:00
proxy: fix error page (#3020)
* fix error page * proxy: fix error page * share dashboard code * fix test
This commit is contained in:
parent
8f6fddebd1
commit
0898dd4f34
5 changed files with 25 additions and 17 deletions
|
@ -4,8 +4,9 @@ import (
|
|||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
|
||||
"github.com/pomerium/csrf"
|
||||
|
||||
"github.com/pomerium/pomerium/ui"
|
||||
)
|
||||
|
||||
// NewRouter returns a new router instance.
|
||||
|
@ -21,3 +22,22 @@ func CSRFFailureHandler(w http.ResponseWriter, r *http.Request) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DashboardSubrouter returns the .pomerium sub router.
|
||||
func DashboardSubrouter(parent *mux.Router) *mux.Router {
|
||||
r := parent.PathPrefix("/.pomerium").Subrouter()
|
||||
for _, fileName := range []string{
|
||||
"apple-touch-icon.png",
|
||||
"favicon-16x16.png",
|
||||
"favicon-32x32.png",
|
||||
"favicon.ico",
|
||||
"index.css",
|
||||
"index.js",
|
||||
} {
|
||||
fileName := fileName
|
||||
r.Path("/" + fileName).Handler(HandlerFunc(func(w http.ResponseWriter, r *http.Request) error {
|
||||
return ui.ServeFile(w, r, fileName)
|
||||
}))
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue