* feat: fixes exception due to unread bytes in stream
* feat: additonal unit tests to cover changes
* fix: automated changes by `make fix-import`
* fix: additonal changes by `make fix-import`
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
* Added fix to include subprotocols from scope
* Added unit test to validate fix
* Changes by black
* Made changes to WebsocketConnection protocol
* Linter changes
* Added unit tests
* Fixing bugs in linting due to isort import checks
* Reverting compat import changes
* Fixing linter errors in compat.py
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
* Version
* Version 20.6.1
* Fix imports and isort to remove from Makefile deprecated options
* duplicate the mypy ignore hint across both lines
after splitting the `from trio import ...` statement onto two lines, need to duplicate the mypy ignore hint across both lines to keep mypy from complaining
Co-authored-by: Ashley Sommer <ashleysommer@gmail.com>
* Socket binding implemented properly for IPv6 and UNIX sockets.
- app.run("::1") for IPv6
- app.run("unix:/tmp/server.sock") for UNIX sockets
- app.run("localhost") retains old functionality (randomly either IPv4 or IPv6)
Do note that IPv6 and UNIX sockets are not fully supported by other Sanic facilities.
In particular, request.server_name and request.server_port are currently unreliable.
* Fix Windows compatibility by not referring to socket.AF_UNIX unless needed.
* Compatibility fix.
* Fix test of existing unix socket.
* Cleaner unix socket removal.
* Remove unix socket on exit also with workers=1.
* More pedantic UNIX socket implementation.
* Refactor app to take unix= argument instead of unix:-prefixed host. Goin' fast @ unix-socket fixed.
* Linter
* Proxy properties cleanup. Slight changes of semantics. SERVER_NAME now overrides everything.
* Have server fill in connection info instead of request asking the socket.
- Would be a good idea to remove request.transport entirely but I didn't dare to touch it yet.
* Linter 💣🌟✊💀
* Fix typing issues. request.server_name returns empty string if host header is missing.
* Fix tests
* Tests were failing, fix connection info.
* Linter nazi says you need that empty line.
* Rename a to addr, leave client empty for unix sockets.
* Add --unix support when sanic is run as module.
* Remove remove_route, deprecated in 19.6.
* Improved unix socket binding.
* More robust creating and unlinking of sockets. Show proper and not temporary name in conn_info.
* Add comprehensive tests for unix socket mode.
* Hide some imports inside functions to avoid Windows failure.
* Mention unix socket mode in deployment docs.
* Fix merge commit.
* Make test_unix_connection_multiple_workers pickleable for spawn mode multiprocessing.
Co-authored-by: L. Kärkkäinen <tronic@users.noreply.github.com>
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
* CHANGELOG for v 20.6 and documentation change for sanic command
* Update CHANGELOG.rst
20.6.0 and 20.6.1 are the same release. One change from `blueprints` had not made it in by accident, therefore the second subsequent release.
Moves the websocket_handler subfunction out to a class-level method, which can be more easily pickled by the built-in python Pickler.
Also includes a similar fix for the add_task deferred task scheduler subfunction.
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
* Bug fix for host parameter issue with lists
As explained in #1772 there is an issue when using a list as an argument for the host parameter in the Blueprint.route() decorator. I've traced the issue back to this line, and the if conditional should ensure that the name attribute isn't accessed when route is None.
* Unit tests for blueprint.route host paramter set to list.
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
* fix-#1856: adjust websockets version to setup.py and make nightly (py39) tests pass
* fix-#1856: set min websockets version to 8.1
* fix-#1856: suppress timeout for CI to pass
* fix-#1856: timeout -> close_timeout due to deprecation warning
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
Co-authored-by: 7 <yunxu1992@gmail.com>
* Fix watchdog reload worker repeatedly if there are multiple changed files
* Simplify autoreloader, don't need multiprocessing.Process. Now works on OSX py38.
* Allow autoreloader with multiple workers and run it earlier.
* This works OK on Windows too.
* I don't see how cwd could be different here.
* app.run and app.create_server argument fixup.
* Add test for auto_reload (coverage not working unfortunately).
* Reloader cleanup, don't use external kill commands and exit normally.
* Strip newlines on test output (Windows-compat).
* Report failures in test_auto_reload to avoid timeouts.
* Use different test server ports to avoid binding problems on Windows.
* Fix previous commit
* Listen on same port after reload.
* Show Goin' Fast banner on reloads.
* More robust testing, also -m sanic.
* Add a timeout to terminate process
* Try a workaround for tmpdir deletion on Windows.
* Join process also on error (context manager doesn't).
* Cleaner autoreloader termination on Windows.
* Remove unused code.
* Rename test.
* Longer timeout on test exit.
Co-authored-by: Hùng X. Lê <lexhung@gmail.com>
Co-authored-by: L. Kärkkäinen <tronic@users.noreply.github.com>
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>