Skip to content

Commit

Permalink
more headers
Browse files Browse the repository at this point in the history
  • Loading branch information
davemolk committed Jan 13, 2023
1 parent 2797abe commit 528cf52
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cmd/bye403/headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ func (b *bye403) manipulateHeaders() [][]string {
"X-Custom-IP-Authorization", "X-Forwarded-For",
"X-Forward-For", "X-Remote-IP", "X-Originating-IP",
"X-Remote-Addr", "X-Client-IP", "X-Real-IP",
"X-Forwarded", "Forwarded-For", "X-ProxyUser-Ip",
"Client-IP", "True-Client-IP", "Cluster-Client-IP",
"X-Original-URL", "X-ProxyUser-IP", "X-Host",
"Host", "X-Forwarded-Host", "Forwarded-Host",
}

values := []string{
Expand All @@ -29,6 +33,6 @@ func (b *bye403) manipulateHeaders() [][]string {
for _, h := range overwrite {
header = append(header, []string{h, b.path})
}

return header
}
9 changes: 8 additions & 1 deletion cmd/bye403/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,20 @@ func (b *bye403) bye403() <-chan struct{} {
headers := b.manipulateHeaders()
for _, h := range headers {
wg.Add(1)
tokens <- struct{}{}
tokens <-struct{}{}
go func(url, method string, headers []string) {
defer wg.Done()
b.request(url, method, headers)
<-tokens
}(b.config.url, http.MethodGet, h)
}
wg.Add(1)
tokens <-struct{}{}
go func(url, method string, headers []string) {
defer wg.Done()
b.request(url, method, headers)
<-tokens
}(b.config.url, http.MethodPost, []string{"X-HTTP-Method-Override", "PUT"})
}
}()
go func() {
Expand Down

0 comments on commit 528cf52

Please sign in to comment.