Fix open-redirect via next parameter, remove dead code
This commit is contained in:
@@ -133,10 +133,7 @@ func (h *Web) setFavorite(w http.ResponseWriter, r *http.Request, star bool) {
|
||||
}
|
||||
itemType := r.FormValue("item_type")
|
||||
itemID := r.FormValue("item_id")
|
||||
next := r.FormValue("next")
|
||||
if next == "" || next[0] != '/' {
|
||||
next = "/"
|
||||
}
|
||||
next := safeRedirectPath(r.FormValue("next"))
|
||||
switch itemType {
|
||||
case "song", "album", "artist":
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user