mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-07-20 10:04:08 +00:00
Ignore Cloudflare Priority header
With these changes, If the web request contains the new Priority header (RFC 9218), The server will ignore it and continue searching for other headers or query parameters.
This commit is contained in:
parent
45ca20dec9
commit
30a913c05c
2 changed files with 21 additions and 7 deletions
|
@ -161,11 +161,6 @@ func ParsePriority(priority string) (int, error) {
|
|||
case "5", "max", "urgent":
|
||||
return 5, nil
|
||||
default:
|
||||
// Ignore new HTTP Priority header (see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-priority)
|
||||
// Cloudflare adds this to requests when forwarding to the backend (ntfy), so we just ignore it.
|
||||
if strings.HasPrefix(p, "u=") {
|
||||
return 3, nil
|
||||
}
|
||||
return 0, errInvalidPriority
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue