Skip to content

Commit

Permalink
Allow application/json as accepted content_type
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelAquilina committed Nov 22, 2018
1 parent a890c90 commit 4615f0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion s4/clients/local.py
Expand Up @@ -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"):
Expand Down
2 changes: 1 addition & 1 deletion s4/clients/s3.py
Expand Up @@ -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"))

Expand Down

0 comments on commit 4615f0e

Please sign in to comment.