diff --git a/src/_bentoml_impl/server/app.py b/src/_bentoml_impl/server/app.py index e3ad2c00135..8c73481812d 100644 --- a/src/_bentoml_impl/server/app.py +++ b/src/_bentoml_impl/server/app.py @@ -772,7 +772,7 @@ async def api_endpoint(self, name: str, request: Request) -> Response: media_type = media_type.split(";")[0].strip() # NOTE: The following check is for security concern, DO NOT REMOVE - if self.is_main and media_type == "application/vnd.bentoml+pickle": + if media_type == "application/vnd.bentoml+pickle": raise BentoMLException( "application/vnd.bentoml+pickle is not allowed in main server", error_code=HTTPStatus.UNSUPPORTED_MEDIA_TYPE,