Fix(API): use right status code
This commit is contained in:
parent
9815010131
commit
60fdd82e2b
2 changed files with 2 additions and 2 deletions
|
@ -119,7 +119,7 @@ func getProxyDelay(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
elm := picker.Wait()
|
||||
if elm == nil {
|
||||
render.Status(r, http.StatusRequestTimeout)
|
||||
render.Status(r, http.StatusGatewayTimeout)
|
||||
render.JSON(w, r, ErrRequestTimeout)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ func Start(addr string, secret string) {
|
|||
if uiPath != "" {
|
||||
r.Group(func(r chi.Router) {
|
||||
fs := http.StripPrefix("/ui", http.FileServer(http.Dir(uiPath)))
|
||||
r.Get("/ui", http.RedirectHandler("/ui/", 301).ServeHTTP)
|
||||
r.Get("/ui", http.RedirectHandler("/ui/", http.StatusTemporaryRedirect).ServeHTTP)
|
||||
r.Get("/ui/*", func(w http.ResponseWriter, r *http.Request) {
|
||||
fs.ServeHTTP(w, r)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue