|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | 3 | import base64 |
4 | | -import warnings |
5 | 4 | from typing import TYPE_CHECKING, Any, Callable |
6 | 5 | from urllib.parse import parse_qs |
7 | 6 |
|
@@ -162,21 +161,16 @@ def get_remaining_time_in_millis(self) -> int: # pragma: no cover |
162 | 161 |
|
163 | 162 | class HttpResolverLocal(ApiGatewayResolver): |
164 | 163 | """ |
165 | | - ASGI-compatible HTTP resolver for local development and testing. |
| 164 | + ASGI-compatible HTTP resolver. |
166 | 165 |
|
167 | | - This resolver is designed specifically for local development workflows. |
168 | | - It allows you to run your Powertools application locally with any ASGI server |
| 166 | + It allows you to run your Powertools application with any ASGI server |
169 | 167 | (uvicorn, hypercorn, daphne, etc.) while maintaining full compatibility with Lambda. |
170 | 168 |
|
171 | 169 | The same code works in both environments - locally via ASGI and in Lambda via the handler. |
| 170 | + If your Lambda is behind Lambda Web Adapter or any other HTTP proxy, it works seamlessly. |
172 | 171 |
|
173 | 172 | Supports both sync and async route handlers. |
174 | 173 |
|
175 | | - WARNING |
176 | | - ------- |
177 | | - This is intended for local development and testing only. |
178 | | - The API may change in future releases. Do not use in production environments. |
179 | | -
|
180 | 174 | Example |
181 | 175 | ------- |
182 | 176 | ```python |
@@ -210,11 +204,6 @@ def __init__( |
210 | 204 | strip_prefixes: list[str | Any] | None = None, |
211 | 205 | enable_validation: bool = False, |
212 | 206 | ): |
213 | | - warnings.warn( |
214 | | - "HttpResolverLocal is intended for local development and testing only. " |
215 | | - "The API may change in future releases. Do not use in production environments.", |
216 | | - stacklevel=2, |
217 | | - ) |
218 | 207 | super().__init__( |
219 | 208 | proxy_type=ProxyEventType.APIGatewayProxyEvent, # Use REST API format internally |
220 | 209 | cors=cors, |
@@ -351,3 +340,6 @@ async def _send_response(self, send: Callable, response: dict) -> None: |
351 | 340 | "body": body_bytes, |
352 | 341 | }, |
353 | 342 | ) |
| 343 | + |
| 344 | + |
| 345 | +HttpResolver = HttpResolverLocal |
0 commit comments