mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 04:42:33 +02:00
fix wrong url passed
This commit is contained in:
parent
71cd2f3948
commit
303a0cce02
2 changed files with 3 additions and 3 deletions
BIN
bin/go-proxy
BIN
bin/go-proxy
Binary file not shown.
|
@ -49,11 +49,11 @@ func NewHTTPRoute(config *ProxyConfig) (*HTTPRoute, error) {
|
|||
PathMode: config.PathMode,
|
||||
}
|
||||
|
||||
director := proxy.Director
|
||||
proxy.Director = nil
|
||||
|
||||
initRewrite := func(pr *httputil.ProxyRequest) {
|
||||
pr.SetURL(url)
|
||||
pr.SetXForwarded()
|
||||
director(pr.Out)
|
||||
}
|
||||
rewrite := initRewrite
|
||||
|
||||
|
@ -78,7 +78,7 @@ func NewHTTPRoute(config *ProxyConfig) (*HTTPRoute, error) {
|
|||
}
|
||||
// disable cache
|
||||
r.Header.Set("Cache-Control", "no-store")
|
||||
|
||||
|
||||
var err error = nil
|
||||
switch {
|
||||
case strings.HasPrefix(contentType[0], "text/html"):
|
||||
|
|
Loading…
Add table
Reference in a new issue