Skip to content

Commit

Permalink
Set own User Agent for http_2xx check (#81)
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Shishkin <me@teran.ru>
  • Loading branch information
teran authored Nov 26, 2024
1 parent 6b9e79e commit d3d2c48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions checkers/http_2xx/http_2xx.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ func (h *http_2xx) check(ctx context.Context) error {
return err
}

req.Header.Set("User-Agent", "anycastd/1.0 (http_2xx checker)")

for k, v := range h.headers {
req.Header.Set(k, v)
}
Expand Down
2 changes: 1 addition & 1 deletion checkers/http_2xx/http_2xx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

var goDefaultHeaders = http.Header{
"Accept-Encoding": []string{"gzip"},
"User-Agent": []string{"Go-http-client/1.1"},
"User-Agent": []string{"anycastd/1.0 (http_2xx checker)"},
}

func init() {
Expand Down

0 comments on commit d3d2c48

Please sign in to comment.