providers/http: Don't accept redirect codes outside 3XX range

This commit is contained in:
Sasha Koshka 2025-04-29 09:33:16 -04:00
parent e72523c036
commit 8b00321812

View File

@ -73,6 +73,11 @@ func funcError (status int, message any) (string, error) {
}
func funcRedirect (status int, pat string) (string, error) {
if status < 300 || status > 399 {
return "", fmt.Errorf(
"provided status code %d is not in the 3XX range",
status)
}
return "", shttp.Redirect {
Status: status,
Location: pat,