From 60fdd82e2b42ace367e70df199a296fff6a6e0d1 Mon Sep 17 00:00:00 2001
From: Dreamacro <305009791@qq.com>
Date: Sun, 8 Sep 2019 22:33:52 +0800
Subject: [PATCH] Fix(API): use right status code

---
 hub/route/proxies.go | 2 +-
 hub/route/server.go  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hub/route/proxies.go b/hub/route/proxies.go
index 7044f057..d485495e 100644
--- a/hub/route/proxies.go
+++ b/hub/route/proxies.go
@@ -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
 	}
diff --git a/hub/route/server.go b/hub/route/server.go
index 7c3a2334..a309944e 100644
--- a/hub/route/server.go
+++ b/hub/route/server.go
@@ -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)
 			})