mirror of
https://git.proxmox.com/git/proxmox
synced 2025-06-30 19:02:24 +00:00
notify: fix #5274: also set 'X-Gotify-Key' header for authentication
Versions of Gotify < 2.2.0 only supported the 'X-Gotify-Key' header for passing the API token. This comment sets this header in addition to the regular 'Authorization' header in order to be compatible with older Gotify servers. Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
parent
6858672642
commit
6b393ac0ce
@ -124,10 +124,13 @@ impl Endpoint for GotifyEndpoint {
|
|||||||
|
|
||||||
let body = serde_json::to_vec(&body)
|
let body = serde_json::to_vec(&body)
|
||||||
.map_err(|err| Error::NotifyFailed(self.name().to_string(), err.into()))?;
|
.map_err(|err| Error::NotifyFailed(self.name().to_string(), err.into()))?;
|
||||||
let extra_headers = HashMap::from([(
|
let extra_headers = HashMap::from([
|
||||||
"Authorization".into(),
|
(
|
||||||
format!("Bearer {}", self.private_config.token),
|
"Authorization".into(),
|
||||||
)]);
|
format!("Bearer {}", self.private_config.token),
|
||||||
|
),
|
||||||
|
("X-Gotify-Key".into(), self.private_config.token.clone()),
|
||||||
|
]);
|
||||||
|
|
||||||
let proxy_config = context()
|
let proxy_config = context()
|
||||||
.http_proxy_config()
|
.http_proxy_config()
|
||||||
|
Loading…
Reference in New Issue
Block a user