mirror of
https://git.phreedom.club/localhost_frssoft/compy.git
synced 2024-11-23 16:41:30 +00:00
fix http requests over https proxy connection
Reconstruct the schema of the proxied request if it's not filled out.
This commit is contained in:
parent
a4a691b7b8
commit
fd53c9cb8c
|
@ -66,7 +66,11 @@ func (p *Proxy) handle(w http.ResponseWriter, r *http.Request) error {
|
|||
|
||||
func forward(r *http.Request) (*http.Response, error) {
|
||||
if r.URL.Scheme == "" {
|
||||
r.URL.Scheme = "https"
|
||||
if r.TLS != nil && r.TLS.ServerName == r.Host {
|
||||
r.URL.Scheme = "https"
|
||||
} else {
|
||||
r.URL.Scheme = "http"
|
||||
}
|
||||
}
|
||||
if r.URL.Host == "" {
|
||||
r.URL.Host = r.Host
|
||||
|
|
Loading…
Reference in a new issue