diff options
author | r <r@freesoftwareextremist.com> | 2019-12-17 20:15:34 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2019-12-17 20:15:34 +0000 |
commit | 47ce7344082ca60287ef3265a51a031741aa7e59 (patch) | |
tree | ed0cc8f93e3cd419b1b1c6473fb22d1fc6d464a0 | |
parent | f68d72ae0eb2eb6c15cd225c1a3b9185aaa20e3f (diff) | |
download | bloat-47ce7344082ca60287ef3265a51a031741aa7e59.tar.gz bloat-47ce7344082ca60287ef3265a51a031741aa7e59.zip |
Use http 302 for redirection instead of 303
-rw-r--r-- | service/transport.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/service/transport.go b/service/transport.go index 377ab23..1326c58 100644 --- a/service/transport.go +++ b/service/transport.go @@ -38,7 +38,7 @@ func NewHandler(s Service, staticDir string) http.Handler { } w.Header().Add("Location", location) - w.WriteHeader(http.StatusSeeOther) + w.WriteHeader(http.StatusFound) }).Methods(http.MethodGet) r.HandleFunc("/signin", func(w http.ResponseWriter, req *http.Request) { @@ -59,7 +59,7 @@ func NewHandler(s Service, staticDir string) http.Handler { w.Header().Add("Set-Cookie", fmt.Sprintf("session_id=%s;max-age=%s", sessionId, cookieAge)) w.Header().Add("Location", url) - w.WriteHeader(http.StatusSeeOther) + w.WriteHeader(http.StatusFound) }).Methods(http.MethodPost) r.HandleFunc("/oauth_callback", func(w http.ResponseWriter, req *http.Request) { @@ -72,7 +72,7 @@ func NewHandler(s Service, staticDir string) http.Handler { } w.Header().Add("Location", "/timeline") - w.WriteHeader(http.StatusSeeOther) + w.WriteHeader(http.StatusFound) }).Methods(http.MethodGet) r.HandleFunc("/timeline", func(w http.ResponseWriter, req *http.Request) { @@ -110,7 +110,7 @@ func NewHandler(s Service, staticDir string) http.Handler { } w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id) - w.WriteHeader(http.StatusSeeOther) + w.WriteHeader(http.StatusFound) }).Methods(http.MethodGet) r.HandleFunc("/unlike/{id}", func(w http.ResponseWriter, req *http.Request) { @@ -123,7 +123,7 @@ func NewHandler(s Service, staticDir string) http.Handler { } w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id) - w.WriteHeader(http.StatusSeeOther) + w.WriteHeader(http.StatusFound) }).Methods(http.MethodGet) r.HandleFunc("/retweet/{id}", func(w http.ResponseWriter, req *http.Request) { @@ -136,7 +136,7 @@ func NewHandler(s Service, staticDir string) http.Handler { } w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id) - w.WriteHeader(http.StatusSeeOther) + w.WriteHeader(http.StatusFound) }).Methods(http.MethodGet) r.HandleFunc("/unretweet/{id}", func(w http.ResponseWriter, req *http.Request) { @@ -149,7 +149,7 @@ func NewHandler(s Service, staticDir string) http.Handler { } w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id) - w.WriteHeader(http.StatusSeeOther) + w.WriteHeader(http.StatusFound) }).Methods(http.MethodGet) r.HandleFunc("/post", func(w http.ResponseWriter, req *http.Request) { @@ -176,7 +176,7 @@ func NewHandler(s Service, staticDir string) http.Handler { location = "/thread/" + replyToID + "#status-" + id } w.Header().Add("Location", location) - w.WriteHeader(http.StatusSeeOther) + w.WriteHeader(http.StatusFound) }).Methods(http.MethodPost) r.HandleFunc("/notifications", func(w http.ResponseWriter, req *http.Request) { @@ -196,7 +196,7 @@ func NewHandler(s Service, staticDir string) http.Handler { // TODO remove session from database w.Header().Add("Set-Cookie", fmt.Sprintf("session_id=;max-age=0")) w.Header().Add("Location", "/") - w.WriteHeader(http.StatusSeeOther) + w.WriteHeader(http.StatusFound) }).Methods(http.MethodGet) return r |