Protocol of uploaded file based on X-Forwarded-Proto

This commit is contained in:
Daedren 2021-10-08 12:42:58 +01:00 committed by ed
parent d1be37a04a
commit 5aff39d2b2

View file

@ -1127,9 +1127,10 @@ class HttpCli(object):
)
# truncated SHA-512 prevents length extension attacks;
# using SHA-512/224, optionally SHA-512/256 = :64
is_https = (self.headers.get("x-forwarded-proto") == "https" or self.tls)
jpart = {
"url": "{}://{}/{}".format(
"https" if self.tls else "http",
"https" if is_https else "http",
self.headers.get("host", "copyparty"),
vpath + vsuf,
),