From 82a04010995a17cee27849ecee7fc1d979a91a93 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 4 Nov 2021 22:10:45 +0100 Subject: [PATCH] at some point firefox became case-sensitive --- copyparty/httpcli.py | 6 +++--- copyparty/util.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 93e52b13..536d4a40 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -298,7 +298,7 @@ class HttpCli(object): # default to utf8 html if no content-type is set if not mime: - mime = self.out_headers.get("Content-Type", "text/html; charset=UTF-8") + mime = self.out_headers.get("Content-Type", "text/html; charset=utf-8") self.out_headers["Content-Type"] = mime @@ -1462,7 +1462,7 @@ class HttpCli(object): self.permit_caching() if "txt" in self.uparam: - mime = "text/plain; charset={}".format(self.uparam["txt"] or "UTF-8") + mime = "text/plain; charset={}".format(self.uparam["txt"] or "utf-8") else: mime = guess_mime(req_path) @@ -1905,7 +1905,7 @@ class HttpCli(object): for x in y ] ret = "\n".join(ret) - mime = "text/plain; charset=UTF-8" + mime = "text/plain; charset=utf-8" else: [x.pop(k) for k in ["name", "dt"] for y in [dirs, files] for x in y] diff --git a/copyparty/util.py b/copyparty/util.py index 130c7518..19d96bf6 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -100,7 +100,7 @@ IMPLICATIONS = [ MIMES = { - "md": "text/plain; charset=UTF-8", + "md": "text/plain; charset=utf-8", "opus": "audio/ogg; codecs=opus", "webp": "image/webp", } @@ -1284,7 +1284,7 @@ def guess_mime(url, fallback="application/octet-stream"): if ";" not in ret: if ret.startswith("text/") or ret.endswith("/javascript"): - ret += "; charset=UTF-8" + ret += "; charset=utf-8" return ret