diff --git a/s4/clients/local.py b/s4/clients/local.py index 10244a4..f919340 100644 --- a/s4/clients/local.py +++ b/s4/clients/local.py @@ -148,7 +148,7 @@ def _load_index(self): return {} content_type = magic.from_file(index_path, mime=True) - if content_type == "text/plain": + if content_type in ("application/json", "text/plain"): logger.debug("Detected plaintext encoding for reading index") method = open elif content_type in ("application/gzip", "application/x-gzip"): diff --git a/s4/clients/s3.py b/s4/clients/s3.py index 06a9ff3..aec05e7 100644 --- a/s4/clients/s3.py +++ b/s4/clients/s3.py @@ -132,7 +132,7 @@ def load_index(self): body = resp["Body"].read() content_type = magic.from_buffer(body, mime=True) - if content_type == "text/plain": + if content_type in ("application/json", "text/plain"): logger.debug("Detected plain text encoding for index") return json.loads(body.decode("utf-8"))