Skip to content

Commit

Permalink
Set Non-Default User Agent for HTTP Requests
Browse files Browse the repository at this point in the history
  • Loading branch information
UNC1739 committed Aug 8, 2024
1 parent b17ab67 commit 4860bc5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/plugins/services/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func (p *HTTPPlugin) Run(conn net.Conn, timeout time.Duration, target plugins.Ta
return http.ErrUseLastResponse
},
}
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36")

Check failure on line 105 in pkg/plugins/services/http/http.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] pkg/plugins/services/http/http.go#L105

line is 144 characters (lll)
Raw output
pkg/plugins/services/http/http.go:105: line is 144 characters (lll)
	req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36")

resp, err := client.Do(req)
if err != nil {
Expand Down Expand Up @@ -157,6 +158,7 @@ func (p *HTTPSPlugin) Run(
return http.ErrUseLastResponse
},
}
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36")

Check failure on line 161 in pkg/plugins/services/http/http.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] pkg/plugins/services/http/http.go#L161

line is 144 characters (lll)
Raw output
pkg/plugins/services/http/http.go:161: line is 144 characters (lll)
	req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36")

resp, err := client.Do(req)
if err != nil {
Expand Down

0 comments on commit 4860bc5

Please sign in to comment.