Skip to content

Commit

Permalink
Fix mirroring from non-https to https endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
rb3ckers committed Jun 4, 2019
1 parent abe5a2d commit 99625b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ func main() {
mirrorMux.HandleFunc("/", func(res http.ResponseWriter, req *http.Request) {
body := bufferRequest(req)

// Update the headers to allow for SSL redirection
req.URL.Host = url.Host
req.URL.Scheme = url.Scheme
req.Host = url.Host

proxyTo.ServeHTTP(res, req)
go sendToMirrors(req, body)
})
Expand Down

0 comments on commit 99625b6

Please sign in to comment.