mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-05-27 17:05:36 +02:00
Simplify
This commit is contained in:
parent
6b1f72fec9
commit
35eac5b9ad
3 changed files with 10 additions and 14 deletions
server
|
@ -117,3 +117,11 @@ func fromContext[T any](r *http.Request, key contextKey) (T, error) {
|
|||
}
|
||||
return t, nil
|
||||
}
|
||||
|
||||
func maybeDecodeHeader(header string) string {
|
||||
decoded, err := mimeDecoder.DecodeHeader(header)
|
||||
if err != nil {
|
||||
return header
|
||||
}
|
||||
return decoded
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue