- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 12 for policy (0.35 sec)
-
fastapi/exception_handlers.py
from starlette.exceptions import HTTPException from starlette.requests import Request from starlette.responses import JSONResponse, Response from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY, WS_1008_POLICY_VIOLATION async def http_exception_handler(request: Request, exc: HTTPException) -> Response: headers = getattr(exc, "headers", None) if not is_body_allowed_for_status_code(exc.status_code):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sun Jun 11 19:08:14 GMT 2023 - 1.3K bytes - Viewed (0) -
docs_src/websockets/tutorial002_py310.py
websocket: WebSocket, session: str | None = Cookie(default=None), token: str | None = Query(default=None), ): if session is None and token is None: raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION) return session or token @app.websocket("/items/{item_id}/ws") async def websocket_endpoint( websocket: WebSocket, item_id: str, q: int | None = None,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 2.7K bytes - Viewed (0) -
docs_src/websockets/tutorial002_an_py310.py
websocket: WebSocket, session: Annotated[str | None, Cookie()] = None, token: Annotated[str | None, Query()] = None, ): if session is None and token is None: raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION) return session or token @app.websocket("/items/{item_id}/ws") async def websocket_endpoint( *, websocket: WebSocket, item_id: str, q: int | None = None,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 2.8K bytes - Viewed (0) -
tests/test_ws_router.py
with client.websocket_connect("/depends-validate/"): pass # pragma: no cover # the validation error does produce a close message assert e.value.code == status.WS_1008_POLICY_VIOLATION # and no error is leaked assert caught == [] def test_depend_err_middleware(): """ Verify that it is possible to write custom WebSocket middleware to catch errors """
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sun Jun 11 19:08:14 GMT 2023 - 7.5K bytes - Viewed (0) -
docs_src/websockets/tutorial002.py
session: Union[str, None] = Cookie(default=None), token: Union[str, None] = Query(default=None), ): if session is None and token is None: raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION) return session or token @app.websocket("/items/{item_id}/ws") async def websocket_endpoint( websocket: WebSocket, item_id: str, q: Union[int, None] = None,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sun Nov 13 16:10:54 GMT 2022 - 2.8K bytes - Viewed (0) -
docs_src/websockets/tutorial002_an.py
session: Annotated[Union[str, None], Cookie()] = None, token: Annotated[Union[str, None], Query()] = None, ): if session is None and token is None: raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION) return session or token @app.websocket("/items/{item_id}/ws") async def websocket_endpoint( *, websocket: WebSocket, item_id: str, q: Union[int, None] = None,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 2.8K bytes - Viewed (0) -
docs_src/websockets/tutorial002_an_py39.py
session: Annotated[Union[str, None], Cookie()] = None, token: Annotated[Union[str, None], Query()] = None, ): if session is None and token is None: raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION) return session or token @app.websocket("/items/{item_id}/ws") async def websocket_endpoint( *, websocket: WebSocket, item_id: str, q: Union[int, None] = None,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 2.8K bytes - Viewed (0) -
fastapi/exceptions.py
*, websocket: WebSocket, session: Annotated[str | None, Cookie()] = None, item_id: str, ): if session is None: raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION) await websocket.accept() while True: data = await websocket.receive_text() await websocket.send_text(f"Session cookie is: {session}")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Apr 02 02:48:51 GMT 2024 - 4.9K bytes - Viewed (0) -
docs/en/docs/release-notes.md
* 🌐 Fix typo in Russian translation for `docs/ru/docs/tutorial/body-fields.md`. PR [#10224](https://github.com/tiangolo/fastapi/pull/10224) by [@AlertRED](https://github.com/AlertRED). * 🌐 Add Polish translation for `docs/pl/docs/help-fastapi.md`. PR [#10121](https://github.com/tiangolo/fastapi/pull/10121) by [@romabozhanovgithub](https://github.com/romabozhanovgithub).
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sun Apr 28 00:28:00 GMT 2024 - 385.5K bytes - Viewed (1) -
docs/pl/docs/index.md
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 23:58:47 GMT 2024 - 19.4K bytes - Viewed (0)