fix: rm example.org origin
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Aravinth Manivannan 2023-10-06 19:13:05 +05:30
parent c4fad0b0d7
commit f569906137
Signed by: realaravinth
GPG key ID: F8F50389936984FF

10
run.py
View file

@ -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: