1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-05-30 18:29:16 +02:00

Upstream access token

This commit is contained in:
binwiederhier 2023-05-18 13:08:10 -04:00
parent f13a654fe8
commit 25d3a66f91
9 changed files with 144 additions and 50 deletions
server

View file

@ -855,7 +855,11 @@ func (s *Server) forwardPollRequest(v *visitor, m *message) {
logvm(v, m).Err(err).Warn("Unable to publish poll request")
return
}
req.Header.Set("User-Agent", "ntfy/"+s.config.Version)
req.Header.Set("X-Poll-ID", m.ID)
if s.config.UpstreamAccessToken != "" {
req.Header.Set("Authorization", util.BearerAuth(s.config.UpstreamAccessToken))
}
var httpClient = &http.Client{
Timeout: time.Second * 10,
}