Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Tests] Avoid request-derived value in Location header of fake Hub se…
…rver

Silences a CodeQL HTTP Response Splitting false positive on the test
fixture: the redirect target is fixed for the test, so build it from
literals instead of from self.path.
  • Loading branch information
assafvayner committed Sep 21, 2026
commit 65cf07403a29484d245a1b392679b298089284ef
3 changes: 2 additions & 1 deletion tests/test_utils_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,8 +992,9 @@ class _SameOriginRedirectHandler(BaseHTTPRequestHandler):

def do_HEAD(self):
if self.path.startswith("/org/repo/resolve/"):
# Redirect to the same file in the renamed repo, on the same origin
self.send_response(302)
self.send_header("Location", "/org/renamed" + self.path[len("/org/repo") :])
self.send_header("Location", "/org/renamed/resolve/main/file.bin")
self.end_headers()
else:
self.send_response(200)
Expand Down
Loading