use the scheme and host from x-forward-proto and x-forward-host if they exits and correct the scheme for Location header during image upload

Signed-off-by: yuzou <zouyu7@huawei.com>
This commit is contained in:
yuzou 2015-10-15 16:56:28 +08:00
parent 13b56c9d20
commit 9c7dc47d80
2 changed files with 43 additions and 10 deletions

View file

@ -204,7 +204,9 @@ func (cr clonedRoute) URL(pairs ...string) (*url.URL, error) {
routeURL.Path = routeURL.Path[1:]
}
return cr.root.ResolveReference(routeURL), nil
url := cr.root.ResolveReference(routeURL)
url.Scheme = cr.root.Scheme
return url, nil
}
// appendValuesURL appends the parameters to the url.