Skip to content

Commit

Permalink
Fix header issue for update req
Browse files Browse the repository at this point in the history
  • Loading branch information
scheibling committed Feb 4, 2024
1 parent 77201d5 commit 0b43619
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ func ListenHealthcheck(cfg *Config) {
return
}

header := w.Header().Get("X-Update-Token")
if header != updateToken {
headerToken := r.Header.Get("X-Update-Token")

if headerToken == "" || headerToken != updateToken {
w.WriteHeader(403)
w.Write([]byte("Invalid token"))
return
Expand Down

0 comments on commit 0b43619

Please sign in to comment.