Use http.StatusTemporaryRedirect instead of hardcoded 307
This commit is contained in:
parent
038cac6a62
commit
857dc5f57c
3 changed files with 8 additions and 8 deletions
10
admin.go
10
admin.go
|
@ -72,9 +72,9 @@ func deleteHandler(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
sess.Save(w, r)
|
||||
if isNew {
|
||||
http.Redirect(w, r, "/new/", 307)
|
||||
http.Redirect(w, r, "/new/", http.StatusTemporaryRedirect)
|
||||
} else {
|
||||
http.Redirect(w, r, "/", 307)
|
||||
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,9 +144,9 @@ func saveHandler(w http.ResponseWriter, r *http.Request) {
|
|||
sess.Notify("Book Modified!", "", "success")
|
||||
sess.Save(w, r)
|
||||
if db.BookActive(id) {
|
||||
http.Redirect(w, r, "/book/"+idStr, 307)
|
||||
http.Redirect(w, r, "/book/"+idStr, http.StatusTemporaryRedirect)
|
||||
} else {
|
||||
http.Redirect(w, r, "/new/", 307)
|
||||
http.Redirect(w, r, "/new/", http.StatusTemporaryRedirect)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -220,5 +220,5 @@ func storeHandler(w http.ResponseWriter, r *http.Request) {
|
|||
sess.Notify("Store books!", "The books '"+strings.Join(titles, ", ")+"' are stored for public download", "success")
|
||||
}
|
||||
sess.Save(w, r)
|
||||
http.Redirect(w, r, "/new/", 307)
|
||||
http.Redirect(w, r, "/new/", http.StatusTemporaryRedirect)
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ func readHandler(w http.ResponseWriter, r *http.Request) {
|
|||
if file == "" {
|
||||
it := e.Iterator(epub.EITERATOR_LINEAR)
|
||||
defer it.Close()
|
||||
http.Redirect(w, r, base+id+"/"+it.CurrUrl(), 307)
|
||||
http.Redirect(w, r, base+id+"/"+it.CurrUrl(), http.StatusTemporaryRedirect)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ func logoutHandler(w http.ResponseWriter, r *http.Request) {
|
|||
sess.LogOut()
|
||||
sess.Notify("Log out!", "Bye bye "+sess.User, "success")
|
||||
sess.Save(w, r)
|
||||
http.Redirect(w, r, "/", 307)
|
||||
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
|
||||
}
|
||||
|
||||
func loginHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -38,7 +38,7 @@ func loginHandler(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
sess.Save(w, r)
|
||||
}
|
||||
http.Redirect(w, r, r.Referer(), 307)
|
||||
http.Redirect(w, r, r.Referer(), http.StatusTemporaryRedirect)
|
||||
}
|
||||
|
||||
type bookData struct {
|
||||
|
|
Reference in a new issue