[release] v0.8.0-unstable3
This commit is contained in:
parent
351d0327e5
commit
6c8b85609c
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.8.0-unstable2",
|
"version": "0.8.0-unstable3",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -17,6 +17,14 @@ func NewProxy(targetHost string, AcceptInsecureHTTPSTarget bool) (*httputil.Reve
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy := httputil.NewSingleHostReverseProxy(url)
|
proxy := httputil.NewSingleHostReverseProxy(url)
|
||||||
|
|
||||||
|
proxy.Director = func(req *http.Request) {
|
||||||
|
req.URL.Scheme = url.Scheme
|
||||||
|
req.URL.Host = url.Host
|
||||||
|
req.Header.Set("X-Forwarded-Host", req.Host)
|
||||||
|
req.Header.Set("X-Forwarded-Proto", url.Scheme)
|
||||||
|
req.Host = url.Host
|
||||||
|
}
|
||||||
|
|
||||||
if AcceptInsecureHTTPSTarget && url.Scheme == "https" {
|
if AcceptInsecureHTTPSTarget && url.Scheme == "https" {
|
||||||
proxy.Transport = &http.Transport{
|
proxy.Transport = &http.Transport{
|
||||||
|
|
Loading…
Reference in a new issue