Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Gzip Middleware #5225

Merged
merged 4 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ The types of changes are:

## [Unreleased](https://github.com/ethyca/fides/compare/2.43.1...main)


### Added
- Added Gzip Middleware for responses [#5225](https://github.com/ethyca/fides/pull/5225)

### Changed
- Removed unused `username` parameter from the Delighted integration configuration [#5220](https://github.com/ethyca/fides/pull/5220)

### Developer Experience
- Sourcemaps are now working for fides-js in debug mode [#5222](https://github.com/ethyca/fides/pull/5222)


## [2.43.1](https://github.com/ethyca/fides/compare/2.43.0...2.43.1)

### Added
Expand Down
4 changes: 4 additions & 0 deletions src/fides/api/app_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import AsyncGenerator, List

from fastapi import APIRouter, FastAPI
from fastapi.middleware.gzip import GZipMiddleware
from fastapi.routing import APIRoute
from loguru import logger
from redis.exceptions import RedisError, ResponseError
Expand Down Expand Up @@ -82,6 +83,9 @@ def create_fides_app(
# Starlette bug causing this to fail mypy
fastapi_app.add_exception_handler(FunctionalityNotConfigured, handler) # type: ignore
fastapi_app.add_middleware(SlowAPIMiddleware)
fastapi_app.add_middleware(
GZipMiddleware, minimum_size=1000, compresslevel=5
) # minimum_size is in bytes

for router in routers:
fastapi_app.include_router(router)
Expand Down