Skip to content

Commit ae7aa2d

Browse files
committed
test: construct error header manually
using send_header before send_error creates a misconstructed header
1 parent ca72c0f commit ae7aa2d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/unit/test_archive.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,9 @@ def getCommon(self):
479479
challenge = 'Basic ' + base64.b64encode(
480480
(username+":"+password).encode("utf-8")).decode("ascii")
481481
if self.headers.get('Authorization') != challenge:
482+
self.send_response(401, "Unauthorized")
482483
self.send_header("WWW-Authenticate", 'Basic realm="default"')
483-
self.send_error(401, "Unauthorized")
484+
self.end_headers()
484485
return None
485486

486487
path = repoPath + self.path

0 commit comments

Comments
 (0)