Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyrrell committed May 5, 2024
2 parents 1c51095 + 4cd8fdc commit 35913a6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/notifiers/ntfy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,20 @@ export class Ntfy extends NotifierService {
constructor(config: NtfyConfig) {
super();
this.config = new NtfyConfig(config);
this.request = new Request(`${this.config.apiUrl}`, {

const { apiUrl, token } = this.config;

const headers = new Headers({
'Content-Type': 'application/json',
});

if (token) {
headers.append('authorization', `Bearer ${token}`);
}

this.request = new Request(`${apiUrl}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', authorization: `Bearer ${this.config.token}` },
headers,
});
}

Expand Down

0 comments on commit 35913a6

Please sign in to comment.