diff --git a/run.py b/run.py index 6de97be..3998212 100755 --- a/run.py +++ b/run.py @@ -62,7 +62,7 @@ def query_webfinger(): ) ) logger.info(f"Query WebFinger: {webfinger}") - res = requests.get(webfinger, headers={"Origin": "http://example.org"}) + res = requests.get(webfinger) logger.debug( f"WebFinger response:\n\nSTATUS: {res.status_code}\n\nHEADERS:\n {res.headers}\n\nRESPONSE PAYLOAD:\n{res.json()}" ) @@ -128,8 +128,8 @@ def test_subject(resp): def test_access_control_allow_origin(resp): # request.headers is case insensitive assert ( - resp.headers["access-control-allow-origin"] == "*" - ), "Access-Control-Allow-Origin header should be '*' to allow any domain to access the resource with CORS. Please see https://www.rfc-editor.org/rfc/rfc7033.html#section-5" + resp.headers["Access-Control-Allow-Origin"] == "*" + ), f"Access-Control-Allow-Origin header should be '*' to allow any domain to access the resource with CORS. Please see https://www.rfc-editor.org/rfc/rfc7033.html#section-5. Got {resp.headers['Access-Control-Allow-Origin']}" logger.info("[SUCESS] WebFinger endpoint is configured correctly for CORS") @@ -149,9 +149,7 @@ def upload_logs_to_ftest(success: bool, logs: str): payload = {"success": success, "logs": logs} - res = requests.post( - ftest, json=payload, headers={"Origin": "http://example.org"} - ) + res = requests.post(ftest, json=payload) if res.status_code == 200: logger.info("Upload successful") else: