Skip to content

Commit fb609f5

Browse files
authored
Fix: Adding application/octet-stream to content type #4772 (#4781)
1 parent 6f5e2bc commit fb609f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sagemaker/model_card/helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,12 @@ def _read_s3_json(session: Session, bucket: str, key: str):
503503
raise
504504

505505
result = {}
506-
if data["ContentType"] == "application/json" or data["ContentType"] == "binary/octet-stream":
506+
content_types = ["application/json", "binary/octet-stream", "application/octet-stream"]
507+
if data["ContentType"] in content_types:
507508
result = json.loads(data["Body"].read().decode("utf-8"))
508509
else:
509510
logger.warning(
510-
"Invalid file type %s. application/json or binary/octet-stream is expected.",
511-
data["ContentType"],
511+
"Invalid file type %s. %s is expected.", data["ContentType"], ", ".join(content_types)
512512
)
513513

514514
return result

0 commit comments

Comments
 (0)