starlette-gzip-request is a custom middleware for supporting HTTP requests compressed with Gzip in Starlette.
This package essentially aims to fill the need presented in encode/starlette#644.
- Python 3.8+ support
- Compatible with
asyncio
andtrio
backends
pip install starlette-gzip-request
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette_gzip_request import GzipRequestMiddleware
middleware = [
Middleware(GzipRequestMiddleware)
]
app = Starlette(routes=..., middleware=middleware)
starlette-gzip-request
can also be used with FastAPI as follows:
from fastapi import FastAPI
from starlette_gzip_request import GzipRequestMiddleware
app = FastAPI()
app.add_middleware(GzipRequestMiddleware)
If you'd like to contribute, please feel free to open a pull request (PR).
Please ensure that your PRs include test coverage to validate your changes. Thank you for helping improve starlette-gzip-request
!
- Bharath Vignesh J K - @RazCrimson