Skip to content

Commit

Permalink
Merge pull request #4 from spreadshirt/support-basic-auth
Browse files Browse the repository at this point in the history
Pass along basic auth credentials
  • Loading branch information
heyLu authored Jun 12, 2023
2 parents dc05674 + 57fb22e commit 72d4cac
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions prom-revisionist.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ func main() {
}
proxyReq.Header = req.Header

username, password, ok := req.BasicAuth()
if ok {
proxyReq.SetBasicAuth(username, password)
}

resp, err := http.DefaultClient.Do(proxyReq)
if err != nil {
log.Printf("failed to created request: %s", err)
Expand Down Expand Up @@ -241,6 +246,11 @@ func main() {
}
proxyReq.Header = req.Header

username, password, ok := req.BasicAuth()
if ok {
proxyReq.SetBasicAuth(username, password)
}

resp, err := http.DefaultClient.Do(proxyReq)
if err != nil {
log.Printf("failed to created request: %s", err)
Expand Down

0 comments on commit 72d4cac

Please sign in to comment.