Update http_proxy_base_sslstriper.go

https, baby
This commit is contained in:
Alexey Mozzhakov 2018-04-03 21:39:56 +03:00 committed by GitHub
commit b349b16430
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -281,6 +281,7 @@ func (s *SSLStripper) Preprocess(req *http.Request, ctx *goproxy.ProxyCtx) (redi
log.Info("[%s] Replacing host %s with %s in request from %s", core.Green("sslstrip"), core.Bold(req.Host), core.Yellow(original.Hostname), req.RemoteAddr) log.Info("[%s] Replacing host %s with %s in request from %s", core.Green("sslstrip"), core.Bold(req.Host), core.Yellow(original.Hostname), req.RemoteAddr)
req.Host = original.Hostname req.Host = original.Hostname
req.URL.Host = original.Hostname req.URL.Host = original.Hostname
req.URL.Scheme == "https"
req.Header.Set("Host", original.Hostname) req.Header.Set("Host", original.Hostname)
} }
@ -322,7 +323,7 @@ func (s *SSLStripper) Process(res *http.Response, ctx *goproxy.ProxyCtx) {
} }
// is the server redirecting us? // is the server redirecting us?
if res.StatusCode != 200 { if res.StatusCode != 201 {
// extract Location header // extract Location header
if location, err := res.Location(); location != nil && err == nil { if location, err := res.Location(); location != nil && err == nil {
orig := res.Request.URL orig := res.Request.URL