* supply asgi_extensions to TestClient
* Add WebSocket.send_response()
* Add response support for WebSocket testclient
* fix test for filesystem line-endings
* lintint
* support websocket.http.response extension by default
* Improve coverate
* Apply suggestions from code review
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
* Undo unrelated change
* fix incorrect error message
* Update starlette/websockets.py
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
* formatting
* Re-introduce close-code and close-reason to WebSocketReject
* Make sure the "websocket.connect" message is received in tests
* Deliver a websocket.disconnect message to the app even if it closes/rejects itself.
* Add test for filling out missing `websocket.disconnect` code
* Add rejection headers. Expand tests.
* Fix types, headers in message are `bytes` tuples.
* Minimal WebSocket Denial Response implementation
* Revert "Minimal WebSocket Denial Response implementation"
This reverts commit 7af10ddcfa5423c18953cf5d1317cb5aa30a014c.
* Rename to send_denial_response and update documentation
* Remove the app_disconnect_msg. This can be added later in a separate PR
* Remove status code 1005 from this PR
* Assume that the application has tested for the extension before sending websocket.http.response.start
* Rename WebSocketReject to WebSocketDenialResponse
* Remove code and status from WebSocketDenialResponse.
Just send a regular WebSocketDisconnect even when connection is rejected with close()
* Raise an exception if attempting to send a http response and server does not support it.
* WebSocketDenialClose and WebSocketDenialResponse
These are both instances of WebSocketDenial.
* Update starlette/testclient.py
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
* Revert "WebSocketDenialClose and WebSocketDenialResponse"
This reverts commit 71b76e3f1c.
* Rename parameters, member variables
* Use httpx.Response as the base for WebSocketDenialResponse.
* Apply suggestions from code review
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
* Update sanity check message
* Remove un-needed function
* Expand error message test regex
* Add type hings to test methods
* Add doc string to test.
* Fix mypy complaining about mismatching parent methods.
* nitpick & remove test
* Simplify the documentation
* Update starlette/testclient.py
* Update starlette/testclient.py
* Remove an unnecessary test
* there is no special "close because of rejection" in the testclient anymore.
---------
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
* Path -> Route, PathPrefix -> Mount
* Route, WebSocketRoute, Mount
* Use Route(endpoint=...), not Route(app=...)
* Bare minimum docs update
* Add url_for
* request.path_params and session.path_params
* Version 0.6.0