Skip to content

Commit 2822c9c

Browse files
Potential fix for code scanning alert no. 38: Bad redirect check
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent d6c6488 commit 2822c9c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cmd/portal-tunnel/http_routes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func (r *httpRoute) rewriteLocation(header http.Header, publicHost, publicScheme
193193
}
194194
parsed.Scheme = publicScheme
195195
parsed.Host = publicHost
196-
case strings.HasPrefix(location, "/") && parsed.Host == "" && (len(location) == 1 || location[1] != '\\'):
196+
case strings.HasPrefix(location, "/") && parsed.Host == "" && (len(location) == 1 || (location[1] != '\\' && location[1] != '/')):
197197
// server-relative redirect
198198
default:
199199
return

0 commit comments

Comments
 (0)