Skip to content

Commit 5dd8409

Browse files
committed
content type case ignore
Signed-off-by: Raphael Glon <[email protected]>
1 parent b009dbc commit 5dd8409

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/huggingface_inference_toolkit/serialization/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
content_type_mapping = {
66
"application/json": Jsoner,
7-
"application/json; charset=UTF-8": Jsoner,
7+
"application/json; charset=utf-8": Jsoner,
88
"text/csv": None,
99
"text/plain": None,
1010
# image types

src/huggingface_inference_toolkit/webservice_starlette.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async def metrics(request):
8484
async def predict(request):
8585
try:
8686
# extracts content from request
87-
content_type = request.headers.get("content-Type", os.environ.get("DEFAULT_CONTENT_TYPE"))
87+
content_type = request.headers.get("content-Type", os.environ.get("DEFAULT_CONTENT_TYPE")).lower()
8888
# try to deserialize payload
8989
deserialized_body = ContentType.get_deserializer(content_type).deserialize(
9090
await request.body()

0 commit comments

Comments
 (0)