mirror of
https://github.com/9001/copyparty.git
synced 2025-08-19 18:02:28 -06:00
Protocol of uploaded file based on X-Forwarded-Proto
This commit is contained in:
parent
d1be37a04a
commit
5aff39d2b2
|
@ -1127,9 +1127,10 @@ class HttpCli(object):
|
||||||
)
|
)
|
||||||
# truncated SHA-512 prevents length extension attacks;
|
# truncated SHA-512 prevents length extension attacks;
|
||||||
# using SHA-512/224, optionally SHA-512/256 = :64
|
# using SHA-512/224, optionally SHA-512/256 = :64
|
||||||
|
is_https = (self.headers.get("x-forwarded-proto") == "https" or self.tls)
|
||||||
jpart = {
|
jpart = {
|
||||||
"url": "{}://{}/{}".format(
|
"url": "{}://{}/{}".format(
|
||||||
"https" if self.tls else "http",
|
"https" if is_https else "http",
|
||||||
self.headers.get("host", "copyparty"),
|
self.headers.get("host", "copyparty"),
|
||||||
vpath + vsuf,
|
vpath + vsuf,
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue