middleware¶
ASGI app middleware.
These are in addition to the middleware available in OPTIMADE Python tools. For more information see https://www.optimade.org/optimade-python-tools/api_reference/server/middleware/.
CheckWronglyVersionedBaseUrlsGateways
¶
Bases: BaseHTTPMiddleware
If a non-supported versioned base URL is supplied to a gateway
return 553 Version Not Supported
.
Source code in optimade_gateway/middleware.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
check_url(url)
async
staticmethod
¶
Check URL path for versioned part.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
URL
|
A complete |
required |
Raises:
Type | Description |
---|---|
VersionNotSupported
|
If the URL represents an OPTIMADE versioned base URL and the version part is not supported by the implementation. |
Source code in optimade_gateway/middleware.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|