From 5aff39d2b2f87cace86992d24f3c037de397f86a Mon Sep 17 00:00:00 2001 From: Daedren <6081828+Daedren@users.noreply.github.com> Date: Fri, 8 Oct 2021 12:42:58 +0100 Subject: [PATCH] Protocol of uploaded file based on X-Forwarded-Proto --- copyparty/httpcli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 7b5eaeee..76bb623a 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -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, ),