Skip to content

Commit 20153a7

Browse files
committed
default content type env var
Signed-off-by: Raphael Glon <oOraph@users.noreply.github.com>
1 parent 068fa09 commit 20153a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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", None)
87+
content_type = request.headers.get("content-Type", os.environ.get("DEFAULT_CONTENT_TYPE"))
8888
# try to deserialize payload
8989
deserialized_body = ContentType.get_deserializer(content_type).deserialize(
9090
await request.body()

0 commit comments

Comments
 (0)