- Uncommented the delete proxy rule button
- Added redirection path escape in dpcore
This commit is contained in:
Toby Chui
2025-06-16 20:16:36 +08:00
parent eb07917c14
commit 0b6dbd49bb
3 changed files with 12 additions and 5 deletions

View File

@@ -330,7 +330,10 @@ func (p *ReverseProxy) ProxyHTTP(rw http.ResponseWriter, req *http.Request, rrr
locationRewrite := res.Header.Get("Location")
originLocation := res.Header.Get("Location")
res.Header.Set("zr-origin-location", originLocation)
decodedOriginLocation, err := url.PathUnescape(originLocation)
if err == nil {
originLocation = decodedOriginLocation
}
if strings.HasPrefix(originLocation, "http://") || strings.HasPrefix(originLocation, "https://") {
//Full path
//Replace the forwarded target with expected Host