providers/http: Don't accept redirect codes outside 3XX range
This commit is contained in:
parent
e72523c036
commit
8b00321812
@ -73,6 +73,11 @@ func funcError (status int, message any) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func funcRedirect (status int, pat string) (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 {
|
return "", shttp.Redirect {
|
||||||
Status: status,
|
Status: status,
|
||||||
Location: pat,
|
Location: pat,
|
||||||
|
Loading…
Reference in New Issue
Block a user