RemoveRootPathMiddleware
Middleware to remove ROOT_PATH from incoming requests and update links in responses.
RemoveRootPathMiddleware
dataclass
¶
Middleware to remove the root path of the request before it is sent to the upstream server.
IMPORTANT: This middleware must be placed early in the middleware chain (ie late in the order of declaration) so that it trims the root_path from the request path before any middleware that may need to use the request path (e.g. EnforceAuthMiddleware).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app
|
Callable[list, Awaitable[None]]
|
|
required |
root_path
|
str
|
|
required |
Source code in src/stac_auth_proxy/middleware/RemoveRootPathMiddleware.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
__call__(scope: Scope, receive: Receive, send: Send) -> None
async
¶
Remove ROOT_PATH from the request path if it exists.
Source code in src/stac_auth_proxy/middleware/RemoveRootPathMiddleware.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|