From f9b38671eca6e60b8e20f40f5287c814825c3d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janek=20Nouvertn=C3=A9?= Date: Sat, 14 Sep 2024 11:55:58 +0200 Subject: [PATCH] feat: Update MessagPack media type (#3732) --- docs/release-notes/whats-new-3.rst | 10 ++++++++++ litestar/enums.py | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/whats-new-3.rst b/docs/release-notes/whats-new-3.rst index 6b64c7ca22..a076ebc8f6 100644 --- a/docs/release-notes/whats-new-3.rst +++ b/docs/release-notes/whats-new-3.rst @@ -194,3 +194,13 @@ Removal of deprecated ``litestar.middleware.exceptions`` module and ``ExceptionH The deprecated ``litestar.middleware.exceptions`` module and the ``ExceptionHandlerMiddleware`` have been removed. Since ``ExceptionHandlerMiddleware`` has been applied automatically behind the scenes if necessary, no action is required. + + +Update MessagePack media type to ``application/vnd.msgpack`` +------------------------------------------------------------ + +Change the media type of :attr:`~enums.MediaType.MESSAGEPACK` and +:attr:`~enums.RequestEncodingType.MESSAGEPACK` from ``application/x-msgpack`` to the +newly introduced official ``application/vnd.msgpack``. + +https://www.iana.org/assignments/media-types/application/vnd.msgpack diff --git a/litestar/enums.py b/litestar/enums.py index a8d9c2daf9..3f0a83fc8f 100644 --- a/litestar/enums.py +++ b/litestar/enums.py @@ -28,7 +28,7 @@ class MediaType(str, Enum): """An Enum for ``Content-Type`` header values.""" JSON = "application/json" - MESSAGEPACK = "application/x-msgpack" + MESSAGEPACK = "application/vnd.msgpack" HTML = "text/html" TEXT = "text/plain" CSS = "text/css" @@ -46,7 +46,7 @@ class RequestEncodingType(str, Enum): """An Enum for request ``Content-Type`` header values designating encoding formats.""" JSON = "application/json" - MESSAGEPACK = "application/x-msgpack" + MESSAGEPACK = "application/vnd.msgpack" MULTI_PART = "multipart/form-data" URL_ENCODED = "application/x-www-form-urlencoded"