fish-hook
fish-hook copied to clipboard
Update sanic to 23.12.1
This PR updates sanic from 0.3.1 to 23.12.1.
Changelog
23.12.1
What's Changed
* Fix broken multiplexer manage by ahopkins in https://github.com/sanic-org/sanic/pull/2895
* Do not strip entity-headers with HTTP status 304 or 412 by Tronic in https://github.com/sanic-org/sanic/pull/2824
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v23.12.0...v23.12.1
23.12
New Contributors
* tjni made their first contribution in https://github.com/sanic-org/sanic/pull/2801
* freddiewanah made their first contribution in https://github.com/sanic-org/sanic/pull/2796
* MichaelHinrichs made their first contribution in https://github.com/sanic-org/sanic/pull/2855
* iAndriy made their first contribution in https://github.com/sanic-org/sanic/pull/2864
* talljosh made their first contribution in https://github.com/sanic-org/sanic/pull/2827
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v23.6.0...v23.12.0
23.12.0
_Current version_
Features
- [2775](https://github.com/sanic-org/sanic/pull/2775) Start and restart arbitrary processes
- [2811](https://github.com/sanic-org/sanic/pull/2811) Cleaner process management in shutdown
- [2812](https://github.com/sanic-org/sanic/pull/2812) Suppress task cancel traceback on open websocket
- [2822](https://github.com/sanic-org/sanic/pull/2822) Listener and signal prioritization
- [2831](https://github.com/sanic-org/sanic/pull/2831) Reduce memory consumption
- [2837](https://github.com/sanic-org/sanic/pull/2837) Accept bare cookies
- [2841](https://github.com/sanic-org/sanic/pull/2841) Add `websocket.handler.<before/after/exception>` signals
- [2805](https://github.com/sanic-org/sanic/pull/2805) Add changed files to reload trigger listeners
- [2813](https://github.com/sanic-org/sanic/pull/2813) Allow for simple signals
- [2827](https://github.com/sanic-org/sanic/pull/2827) Improve functionality and consistency of `Sanic.event()`
- [2851](https://github.com/sanic-org/sanic/pull/2851) Allow range requests for a single byte
- [2854](https://github.com/sanic-org/sanic/pull/2854) Better `Request.scheme` for websocket requests
- [2858](https://github.com/sanic-org/sanic/pull/2858) Convert Sanic `Request` to a Websockets `Request` for handshake
- [2859](https://github.com/sanic-org/sanic/pull/2859) Add a REPL to the `sanic` CLI
- [2870](https://github.com/sanic-org/sanic/pull/2870) Add Python 3.12 support
- [2875](https://github.com/sanic-org/sanic/pull/2875) Better exception on multiprocessing context conflicts
Bugfixes
- [2803](https://github.com/sanic-org/sanic/pull/2803) Fix MOTD display for extra data
Deprecations and Removals
Developer infrastructure
- [2796](https://github.com/sanic-org/sanic/pull/2796) Refactor unit test cases
- [2801](https://github.com/sanic-org/sanic/pull/2801) Fix `test_fast` when there is only one CPU
- [2807](https://github.com/sanic-org/sanic/pull/2807) Add constraint for autodocsum (lint issue in old package version)
- [2808](https://github.com/sanic-org/sanic/pull/2808) Refactor GitHub Actions
- [2814](https://github.com/sanic-org/sanic/pull/2814) Run CI pipeline on git push
- [2846](https://github.com/sanic-org/sanic/pull/2846) Drop old performance tests/benchmarks
- [2848](https://github.com/sanic-org/sanic/pull/2848) Makefile cleanup
- [2865](https://github.com/sanic-org/sanic/pull/2865)
[2869](https://github.com/sanic-org/sanic/pull/2869)
[2872](https://github.com/sanic-org/sanic/pull/2872)
[2879](https://github.com/sanic-org/sanic/pull/2879)
Add ruff to toolchain
- [2866](https://github.com/sanic-org/sanic/pull/2866) Fix the alt svc test to run locally with explicit buffer nbytes
- [2877](https://github.com/sanic-org/sanic/pull/2877) Use Python's trusted publisher in deployments
- [2882](https://github.com/sanic-org/sanic/pull/2882) Introduce dynamic port fixture in targeted locations in the test suite
Improved Documentation
- [2781](https://github.com/sanic-org/sanic/pull/2781)
[2821](https://github.com/sanic-org/sanic/pull/2821)
[2861](https://github.com/sanic-org/sanic/pull/2861)
[2863](https://github.com/sanic-org/sanic/pull/2863)
Conversion of User Guide to the SHH (Sanic, html5tagger, HTMX) stack
- [2810](https://github.com/sanic-org/sanic/pull/2810) Update README
- [2855](https://github.com/sanic-org/sanic/pull/2855) Edit Discord badge
- [2864](https://github.com/sanic-org/sanic/pull/2864) Adjust documentation for using state properties within http/https redirection document
---
What's Changed
* Add constraint for autodocsumm by prryplatypus in https://github.com/sanic-org/sanic/pull/2807
* Update README by prryplatypus in https://github.com/sanic-org/sanic/pull/2810
* Refactor GitHub Actions by prryplatypus in https://github.com/sanic-org/sanic/pull/2808
* Suppress task cancel traceback by ahopkins in https://github.com/sanic-org/sanic/pull/2812
* Run tests on push as well by prryplatypus in https://github.com/sanic-org/sanic/pull/2814
* Conversion of User Guide to the SHH stack by ahopkins in https://github.com/sanic-org/sanic/pull/2781
* Fix test_fast when there's only one CPU by tjni in https://github.com/sanic-org/sanic/pull/2801
* Refactoring unit test cases by freddiewanah in https://github.com/sanic-org/sanic/pull/2796
* Accept bare cookies by Tronic in https://github.com/sanic-org/sanic/pull/2837
* Allow range requests for a single byte by Tronic in https://github.com/sanic-org/sanic/pull/2851
* Edit Discord badge. by MichaelHinrichs in https://github.com/sanic-org/sanic/pull/2855
* Makefile cleanup by ChihweiLHBird in https://github.com/sanic-org/sanic/pull/2848
* Drop old performance tests/benchmarks by sjsadowski in https://github.com/sanic-org/sanic/pull/2846
* Add websocket.handler.before/after/exception signals by Tronic in https://github.com/sanic-org/sanic/pull/2841
* Reducing memory consumption by gluhar2006 in https://github.com/sanic-org/sanic/pull/2831
* Improvements to documentation by ahopkins in https://github.com/sanic-org/sanic/pull/2821
* Add missing requirement by ahopkins in https://github.com/sanic-org/sanic/pull/2861
* Fix MOTD for extra data by ahopkins in https://github.com/sanic-org/sanic/pull/2803
* Style changes for mobile by ahopkins in https://github.com/sanic-org/sanic/pull/2863
* Add ruff to toolchain by ahopkins in https://github.com/sanic-org/sanic/pull/2865
* Allow for simple signals by ahopkins in https://github.com/sanic-org/sanic/pull/2813
* issue:2832 Adjust documentation for using state properties within http -> https redirects doc. by iAndriy in https://github.com/sanic-org/sanic/pull/2864
* Fix the alt svc test to run locally with explicit buffer nbytes by ahopkins in https://github.com/sanic-org/sanic/pull/2866
* Add changed files to reload trigger listener by ahopkins in https://github.com/sanic-org/sanic/pull/2805
* Introduce ruff execution on the examples and scripts folder 2867 by iAndriy in https://github.com/sanic-org/sanic/pull/2869
* Cleaner process management by ahopkins in https://github.com/sanic-org/sanic/pull/2811
* Improve functionality and consistency of Sanic.event() by talljosh in https://github.com/sanic-org/sanic/pull/2827
* Make request.scheme return ws/wss for WS even when http/https in SERVER_NAME or proxy headers by Tronic in https://github.com/sanic-org/sanic/pull/2854
* Add support for listener and signal prioritization by ahopkins in https://github.com/sanic-org/sanic/pull/2822
* Better exception on multiprocessing context conflicts by ahopkins in https://github.com/sanic-org/sanic/pull/2875
* Convert Sanic `Request` to WebSocket `Request` in `websocket_handshake` by ChihweiLHBird in https://github.com/sanic-org/sanic/pull/2858
* Introduce ruff execution on the tests folder 2871 by iAndriy in https://github.com/sanic-org/sanic/pull/2872
* Add a REPL to the CLI by ahopkins in https://github.com/sanic-org/sanic/pull/2859
* Use trusted publisher by prryplatypus in https://github.com/sanic-org/sanic/pull/2877
* Support for Python 3.12 2836 by iAndriy in https://github.com/sanic-org/sanic/pull/2870
* Introduce ruff execution on the guides folder 2876 by iAndriy in https://github.com/sanic-org/sanic/pull/2879
* Introduce dynamic port fixture for test_app and helper function for tests which require port within a loop. by iAndriy in https://github.com/sanic-org/sanic/pull/2882
* Start and restart arbitrary processes by ahopkins in https://github.com/sanic-org/sanic/pull/2775
23.6.0
Features
- [2670](https://github.com/sanic-org/sanic/pull/2670) Increase `KEEP_ALIVE_TIMEOUT` default to 120 seconds
- [2716](https://github.com/sanic-org/sanic/pull/2716) Adding allow route overwrite option in blueprint
- [2724](https://github.com/sanic-org/sanic/pull/2724) and [#2792](https://github.com/sanic-org/sanic/pull/2792) Add a new exception signal for ALL exceptions raised anywhere in application
- [2727](https://github.com/sanic-org/sanic/pull/2727) Add name prefixing to BP groups
- [2754](https://github.com/sanic-org/sanic/pull/2754) Update request type on middleware types
- [2770](https://github.com/sanic-org/sanic/pull/2770) Better exception message on startup time application induced import error
- [2776](https://github.com/sanic-org/sanic/pull/2776) Set multiprocessing start method early
- [2785](https://github.com/sanic-org/sanic/pull/2785) Add custom typing to config and ctx objects
- [2790](https://github.com/sanic-org/sanic/pull/2790) Add `request.client_ip`
Bugfixes
- [2728](https://github.com/sanic-org/sanic/pull/2728) Fix traversals for intended results
- [2729](https://github.com/sanic-org/sanic/pull/2729) Handle case when headers argument of ResponseStream constructor is None
- [2737](https://github.com/sanic-org/sanic/pull/2737) Fix type annotation for `JSONREsponse` default content type
- [2740](https://github.com/sanic-org/sanic/pull/2740) Use Sanic's serializer for JSON responses in the Inspector
- [2760](https://github.com/sanic-org/sanic/pull/2760) Support for `Request.get_current` in ASGI mode
- [2773](https://github.com/sanic-org/sanic/pull/2773) Alow Blueprint routes to explicitly define error_format
- [2774](https://github.com/sanic-org/sanic/pull/2774) Resolve headers on different renderers
- [2782](https://github.com/sanic-org/sanic/pull/2782) Resolve pypy compatibility issues
Deprecations and Removals
- [2777](https://github.com/sanic-org/sanic/pull/2777) Remove Python 3.7 support
Developer infrastructure
- [2766](https://github.com/sanic-org/sanic/pull/2766) Unpin setuptools version
- [2779](https://github.com/sanic-org/sanic/pull/2779) Run keep alive tests in loop to get available port
Improved Documentation
- [2741](https://github.com/sanic-org/sanic/pull/2741) Better documentation examples about running Sanic
From that list, the items to highlight in the release notes:
---
What's Changed
* Fix JSONResponse default content type by prryplatypus in https://github.com/sanic-org/sanic/pull/2737
* Fix issue in getting current request through classmethod when served through a different ASGI server by Thirumalai in https://github.com/sanic-org/sanic/pull/2760
* Unpin setuptools version by ChihweiLHBird in https://github.com/sanic-org/sanic/pull/2766
* Sanic on pypy by deounix in https://github.com/sanic-org/sanic/pull/2682
* fix examples for freeze_support() issue on windows by deounix in https://github.com/sanic-org/sanic/pull/2741
* fix 2757 - Improved error messaging on startup time application induced import error by moshe742 in https://github.com/sanic-org/sanic/pull/2770
* Fix Inner bug: TypeError: __init__() got an unexpected keyword argument 'escape_forward_slashes' 2740 by chidoben in https://github.com/sanic-org/sanic/pull/2772
* Add name prefixing to BP groups by ahopkins in https://github.com/sanic-org/sanic/pull/2727
* Adding allow route overwrite option in blueprint by ChihweiLHBird in https://github.com/sanic-org/sanic/pull/2716
* Fix traversals for intended results by ahopkins in https://github.com/sanic-org/sanic/pull/2728
* Update request type on middleware types by guacs in https://github.com/sanic-org/sanic/pull/2754
* Resolve headers on different renderers - Issue 2749 by ahopkins in https://github.com/sanic-org/sanic/pull/2774
* Handle case when `headers` argument of `ResponseStream` constructor is `None` by liamcoatman in https://github.com/sanic-org/sanic/pull/2729
* Add a new exception signal for ALL exceptions raised anywhere in application by ahopkins in https://github.com/sanic-org/sanic/pull/2724
* Alow Blueprint routes to explicitly define error_format by moshe742 in https://github.com/sanic-org/sanic/pull/2773
* Remove Python3.7 support by ahopkins in https://github.com/sanic-org/sanic/pull/2777
* Set multiprocessing start method early by ahopkins in https://github.com/sanic-org/sanic/pull/2776
* Run keep alive tests in loop to get available port by ahopkins in https://github.com/sanic-org/sanic/pull/2779
* Increase KEEP_ALIVE_TIMEOUT default to 120 seconds by Tronic in https://github.com/sanic-org/sanic/pull/2670
* Update bug-report.yml by ahopkins in https://github.com/sanic-org/sanic/pull/2787
* Update bug-report.yml by ahopkins in https://github.com/sanic-org/sanic/pull/2788
* Add custom typing to config and ctx by ahopkins in https://github.com/sanic-org/sanic/pull/2785
* Add request.client_ip by Tronic in https://github.com/sanic-org/sanic/pull/2790
* Add convenience method for exception reporting by ahopkins in https://github.com/sanic-org/sanic/pull/2792
* Prepare for v23.6 release by ahopkins in https://github.com/sanic-org/sanic/pull/2797
New Contributors
* Thirumalai made their first contribution in https://github.com/sanic-org/sanic/pull/2760
* moshe742 made their first contribution in https://github.com/sanic-org/sanic/pull/2770
* chidoben made their first contribution in https://github.com/sanic-org/sanic/pull/2772
* guacs made their first contribution in https://github.com/sanic-org/sanic/pull/2754
* liamcoatman made their first contribution in https://github.com/sanic-org/sanic/pull/2729
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v23.3.0...v23.6.0
23.3.0
Features
- [2545](https://github.com/sanic-org/sanic/pull/2545) Standardize init of exceptions for more consistent control of HTTP responses using exceptions
- [2606](https://github.com/sanic-org/sanic/pull/2606) Decode headers as UTF-8 also in ASGI
- [2646](https://github.com/sanic-org/sanic/pull/2646) Separate ASGI request and lifespan callables
- [2659](https://github.com/sanic-org/sanic/pull/2659) Use ``FALLBACK_ERROR_FORMAT`` for handlers that return ``empty()``
- [2662](https://github.com/sanic-org/sanic/pull/2662) Add basic file browser (HTML page) and auto-index serving
- [2667](https://github.com/sanic-org/sanic/pull/2667) Nicer traceback formatting (HTML page)
- [2668](https://github.com/sanic-org/sanic/pull/2668) Smarter error page rendering format selection; more reliant upon header and "common sense" defaults
- [2680](https://github.com/sanic-org/sanic/pull/2680) Check the status of socket before shutting down with ``SHUT_RDWR``
- [2687](https://github.com/sanic-org/sanic/pull/2687) Refresh ``Request.accept`` functionality to be more performant and spec-compliant
- [2696](https://github.com/sanic-org/sanic/pull/2696) Add header accessors as properties
Example-Field: Foo, Bar
Example-Field: Baz
python
request.headers.example_field == "Foo, Bar,Baz"
- [2700](https://github.com/sanic-org/sanic/pull/2700) Simpler CLI targets
sh
$ sanic path.to.module:app global app instance
$ sanic path.to.module:create_app factory pattern
$ sanic ./path/to/directory/ simple serve
- [2701](https://github.com/sanic-org/sanic/pull/2701) API to define a number of workers in managed processes
- [2704](https://github.com/sanic-org/sanic/pull/2704) Add convenience for dynamic changes to routing
- [2706](https://github.com/sanic-org/sanic/pull/2706) Add convenience methods for cookie creation and deletion
python
response = text("...")
response.add_cookie("test", "It worked!", domain=".yummy-yummy-cookie.com")
- [2707](https://github.com/sanic-org/sanic/pull/2707) Simplified ``parse_content_header`` escaping to be RFC-compliant and remove outdated FF hack
- [2710](https://github.com/sanic-org/sanic/pull/2710) Stricter charset handling and escaping of request URLs
- [2711](https://github.com/sanic-org/sanic/pull/2711) Consume body on ``DELETE`` by default
- [2719](https://github.com/sanic-org/sanic/pull/2719) Allow ``password`` to be passed to TLS context
- [2720](https://github.com/sanic-org/sanic/pull/2720) Skip middleware on ``RequestCancelled``
- [2721](https://github.com/sanic-org/sanic/pull/2721) Change access logging format to ``%s``
- [2722](https://github.com/sanic-org/sanic/pull/2722) Add ``CertLoader`` as application option for directly controlling ``SSLContext`` objects
- [2725](https://github.com/sanic-org/sanic/pull/2725) Worker sync state tolerance on race condition
Bugfixes
- [2651](https://github.com/sanic-org/sanic/pull/2651) ASGI websocket to pass thru bytes as is
- [2697](https://github.com/sanic-org/sanic/pull/2697) Fix comparison between datetime aware and naive in ``file`` when using ``If-Modified-Since``
Deprecations and Removals
- [2666](https://github.com/sanic-org/sanic/pull/2666) Remove deprecated ``__blueprintname__`` property
Improved Documentation
- [2712](https://github.com/sanic-org/sanic/pull/2712) Improved example using ``'https'`` to create the redirect
---
New Contributors
* r0x0d made their first contribution in https://github.com/sanic-org/sanic/pull/2666
* deounix made their first contribution in https://github.com/sanic-org/sanic/pull/2680
* mbendiksen made their first contribution in https://github.com/sanic-org/sanic/pull/2712
* stricaud made their first contribution in https://github.com/sanic-org/sanic/pull/2697
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v22.12.0...v23.3.0
22.12.0
Features
- [2569](https://github.com/sanic-org/sanic/pull/2569) Add `JSONResponse` class with some convenient methods when updating a response object
- [2598](https://github.com/sanic-org/sanic/pull/2598) Change `uvloop` requirement to `>=0.15.0`
- [2609](https://github.com/sanic-org/sanic/pull/2609) Add compatibility with `websockets` v11.0
- [2610](https://github.com/sanic-org/sanic/pull/2610) Kill server early on worker error
- Raise deadlock timeout to 30s
- [2617](https://github.com/sanic-org/sanic/pull/2617) Scale number of running server workers
- [2621](https://github.com/sanic-org/sanic/pull/2621) [#2634](https://github.com/sanic-org/sanic/pull/2634) Send `SIGKILL` on subsequent `ctrl+c` to force worker exit
- [2622](https://github.com/sanic-org/sanic/pull/2622) Add API to restart all workers from the multiplexer
- [2624](https://github.com/sanic-org/sanic/pull/2624) Default to `spawn` for all subprocesses unless specifically set:
python
from sanic import Sanic
Sanic.start_method = "fork"
- [2625](https://github.com/sanic-org/sanic/pull/2625) Filename normalisation of form-data/multipart file uploads
- [2626](https://github.com/sanic-org/sanic/pull/2626) Move to HTTP Inspector:
- Remote access to inspect running Sanic instances
- TLS support for encrypted calls to Inspector
- Authentication to Inspector with API key
- Ability to extend Inspector with custom commands
- [2632](https://github.com/sanic-org/sanic/pull/2632) Control order of restart operations
- [2633](https://github.com/sanic-org/sanic/pull/2633) Move reload interval to class variable
- [2636](https://github.com/sanic-org/sanic/pull/2636) Add `priority` to `register_middleware` method
- [2639](https://github.com/sanic-org/sanic/pull/2639) Add `unquote` to `add_route` method
- [2640](https://github.com/sanic-org/sanic/pull/2640) ASGI websockets to receive `text` or `bytes`
Bugfixes
- [2607](https://github.com/sanic-org/sanic/pull/2607) Force socket shutdown before close to allow rebinding
- [2590](https://github.com/sanic-org/sanic/pull/2590) Use actual `StrEnum` in Python 3.11+
- [2615](https://github.com/sanic-org/sanic/pull/2615) Ensure middleware executes only once per request timeout
- [2627](https://github.com/sanic-org/sanic/pull/2627) Crash ASGI application on lifespan failure
- [2635](https://github.com/sanic-org/sanic/pull/2635) Resolve error with low-level server creation on Windows
Deprecations and Removals
- [2608](https://github.com/sanic-org/sanic/pull/2608) [#2630](https://github.com/sanic-org/sanic/pull/2630) Signal conditions and triggers saved on `signal.extra`
- [2626](https://github.com/sanic-org/sanic/pull/2626) Move to HTTP Inspector
- 🚨 *BREAKING CHANGE*: Moves the Inspector to a Sanic app from a simple TCP socket with a custom protocol
- *DEPRECATE*: The `--inspect*` commands have been deprecated in favor of `inspect ...` commands
- [2628](https://github.com/sanic-org/sanic/pull/2628) Replace deprecated `distutils.strtobool`
Developer infrastructure
- [2612](https://github.com/sanic-org/sanic/pull/2612) Add CI testing for Python 3.11
---
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v22.9.1...v22.12.0
22.9.1
What's Changed
* docs: sanic now supports windows by SaidBySolo in https://github.com/sanic-org/sanic/pull/2582
* Upgrade markdown templates to issue forms by ahopkins in https://github.com/sanic-org/sanic/pull/2588
* improve error message if no apps found in registry by scardozos in https://github.com/sanic-org/sanic/pull/2585
* fix: sideeffects created by changing fork to spawn by SaidBySolo in https://github.com/sanic-org/sanic/pull/2591
* 22.9 Docs by ahopkins in https://github.com/sanic-org/sanic/pull/2556
* Add interval sleep in reloader by ahopkins in https://github.com/sanic-org/sanic/pull/2595
* Resolve edge case in nested BP Groups by ahopkins in https://github.com/sanic-org/sanic/pull/2592
* Add GenericCreator for loading SSL certs in processes by ahopkins in https://github.com/sanic-org/sanic/pull/2578
New Contributors
* scardozos made their first contribution in https://github.com/sanic-org/sanic/pull/2585
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v22.9.0...v22.9.1
22.9.0
Features
- [2445](https://github.com/sanic-org/sanic/pull/2445) Add custom loads function
- [2490](https://github.com/sanic-org/sanic/pull/2490) Make `WebsocketImplProtocol` async iterable
- [2499](https://github.com/sanic-org/sanic/pull/2499) Sanic Server WorkerManager refactor
- [2506](https://github.com/sanic-org/sanic/pull/2506) Use `pathlib` for path resolution (for static file serving)
- [2508](https://github.com/sanic-org/sanic/pull/2508) Use `path.parts` instead of `match` (for static file serving)
- [2513](https://github.com/sanic-org/sanic/pull/2513) Better request cancel handling
- [2516](https://github.com/sanic-org/sanic/pull/2516) Add request properties for HTTP method info:
- `request.is_safe`
- `request.is_idempotent`
- `request.is_cacheable`
- *See* [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) *for more information about when these apply*
- [2522](https://github.com/sanic-org/sanic/pull/2522) Always show server location in ASGI
- [2526](https://github.com/sanic-org/sanic/pull/2526) Cache control support for static files for returning 304 when appropriate
- [2533](https://github.com/sanic-org/sanic/pull/2533) Refactor `_static_request_handler`
- [2540](https://github.com/sanic-org/sanic/pull/2540) Add signals before and after handler execution
- `http.handler.before`
- `http.handler.after`
- [2542](https://github.com/sanic-org/sanic/pull/2542) Add *[redacted]* to CLI :)
- [2546](https://github.com/sanic-org/sanic/pull/2546) Add deprecation warning filter
- [2550](https://github.com/sanic-org/sanic/pull/2550) Middleware priority and performance enhancements
Bugfixes
- [2495](https://github.com/sanic-org/sanic/pull/2495) Prevent directory traversion with static files
- [2515](https://github.com/sanic-org/sanic/pull/2515) Do not apply double slash to paths in certain static dirs in Blueprints
Deprecations and Removals
- [2525](https://github.com/sanic-org/sanic/pull/2525) Warn on duplicate route names, will be prevented outright in v23.3
- [2537](https://github.com/sanic-org/sanic/pull/2537) Raise warning and deprecation notice on duplicate exceptions, will be prevented outright in v23.3
Developer infrastructure
- [2504](https://github.com/sanic-org/sanic/pull/2504) Cleanup test suite
- [2505](https://github.com/sanic-org/sanic/pull/2505) Replace Unsupported Python Version Number from the Contributing Doc
- [2530](https://github.com/sanic-org/sanic/pull/2530) Do not include tests folder in installed package resolver
Improved Documentation
- [2502](https://github.com/sanic-org/sanic/pull/2502) Fix a few typos
- [2517](https://github.com/sanic-org/sanic/pull/2517) [#2536](https://github.com/sanic-org/sanic/pull/2536) Add some type hints
---
New Contributors
* huntzhan made their first contribution in https://github.com/sanic-org/sanic/pull/2530
* monosans made their first contribution in https://github.com/sanic-org/sanic/pull/2536
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v22.6.0...v22.9.0
22.6.2
2522 Always show server location in ASGI
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v22.6.1...v22.6.2
22.6.1
Resolves 2477 and 2478
See also 2495 and https://github.com/sanic-org/sanic/security/advisories/GHSA-8cw9-5hmv-77w6
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v22.6.0...v22.6.1
22.6.0
Features
- [2378](https://github.com/sanic-org/sanic/pull/2378) Introduce HTTP/3 and autogeneration of TLS certificates in `DEBUG` mode
- 👶 *EARLY RELEASE FEATURE*: Serving Sanic over HTTP/3 is an early release feature. It does not yet fully cover the HTTP/3 spec, but instead aims for feature parity with Sanic's existing HTTP/1.1 server. Websockets, WebTransport, push responses are examples of some features not yet implemented.
- 📦 *EXTRA REQUIREMENT*: Not all HTTP clients are capable of interfacing with HTTP/3 servers. You may need to install a [HTTP/3 capable client](https://curl.se/docs/http3.html).
- 📦 *EXTRA REQUIREMENT*: In order to use TLS autogeneration, you must install either [mkcert](https://github.com/FiloSottile/mkcert) or [trustme](https://github.com/python-trio/trustme).
- [2416](https://github.com/sanic-org/sanic/pull/2416) Add message to `task.cancel`
- [2420](https://github.com/sanic-org/sanic/pull/2420) Add exception aliases for more consistent naming with standard HTTP response types (`BadRequest`, `MethodNotAllowed`, `RangeNotSatisfiable`)
- [2432](https://github.com/sanic-org/sanic/pull/2432) Expose ASGI `scope` as a property on the `Request` object
- [2438](https://github.com/sanic-org/sanic/pull/2438) Easier access to websocket class for annotation: `from sanic import Websocket`
- [2439](https://github.com/sanic-org/sanic/pull/2439) New API for reading form values with options: `Request.get_form`
- [2445](https://github.com/sanic-org/sanic/pull/2445) Add custom `loads` function
- [2447](https://github.com/sanic-org/sanic/pull/2447), [#2486](https://github.com/sanic-org/sanic/pull/2486) Improved API to support setting cache control headers
- [2453](https://github.com/sanic-org/sanic/pull/2453) Move verbosity filtering to logger
- [2475](https://github.com/sanic-org/sanic/pull/2475) Expose getter for current request using `Request.get_current()`
Bugfixes
- [2448](https://github.com/sanic-org/sanic/pull/2448) Fix to allow running with `pythonw.exe` or places where there is no `sys.stdout`
- [2451](https://github.com/sanic-org/sanic/pull/2451) Trigger `http.lifecycle.request` signal in ASGI mode
- [2455](https://github.com/sanic-org/sanic/pull/2455) Resolve typing of stacked route definitions
- [2463](https://github.com/sanic-org/sanic/pull/2463) Properly catch websocket CancelledError in websocket handler in Python 3.7
Deprecations and Removals
- [2487](https://github.com/sanic-org/sanic/pull/2487) v22.6 deprecations and changes
1. Optional application registry
1. Execution of custom handlers after some part of response was sent
1. Configuring fallback handlers on the `ErrorHandler`
1. Custom `LOGO` setting
1. `sanic.response.stream`
1. `AsyncioServer.init`
Developer infrastructure
- [2449](https://github.com/sanic-org/sanic/pull/2449) Clean up `black` and `isort` config
- [2479](https://github.com/sanic-org/sanic/pull/2479) Fix some flappy tests
Improved Documentation
- [2461](https://github.com/sanic-org/sanic/pull/2461) Update example to match current application naming standards
- [2466](https://github.com/sanic-org/sanic/pull/2466) Better type annotation for `Extend`
- [2485](https://github.com/sanic-org/sanic/pull/2485) Improved help messages in CLI
---
New Contributors
* azimovMichael made their first contribution in https://github.com/sanic-org/sanic/pull/2432
* amitay87 made their first contribution in https://github.com/sanic-org/sanic/pull/2461
* zozzz made their first contribution in https://github.com/sanic-org/sanic/pull/2451
* kijk2869 made their first contribution in https://github.com/sanic-org/sanic/pull/2466
* timmo001 made their first contribution in https://github.com/sanic-org/sanic/pull/2448
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v22.3.1...v22.6.0
22.3.2
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v22.3.1...v22.3.2
- Resolve warning issue with error handler mismatch warning
https://github.com/sanic-org/sanic/commit/3a1a9f071df24e2fe0ff5aac7d529019034fe898
22.3.1
What's Changed
* Add fall back for Windows even loop fetching by ahopkins in https://github.com/sanic-org/sanic/pull/2421
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v22.3.0...v22.3.1
22.3.0
Features
- [2347](https://github.com/sanic-org/sanic/pull/2347) API for multi-application server
- 🚨 *BREAKING CHANGE*: The old `sanic.worker.GunicornWorker` has been **removed**. To run Sanic with `gunicorn`, you should use it thru `uvicorn` [as described in their docs](https://www.uvicorn.org/#running-with-gunicorn).
- 🧁 *SIDE EFFECT*: Named background tasks are now supported, even in Python 3.7
- [2357](https://github.com/sanic-org/sanic/pull/2357) Parse `Authorization` header as `Request.credentials`
- [2361](https://github.com/sanic-org/sanic/pull/2361) Add config option to skip `Touchup` step in application startup
- [2372](https://github.com/sanic-org/sanic/pull/2372) Updates to CLI help messaging
- [2382](https://github.com/sanic-org/sanic/pull/2382) Downgrade warnings to backwater debug messages
- [2396](https://github.com/sanic-org/sanic/pull/2396) Allow for `multidict` v0.6
- [2401](https://github.com/sanic-org/sanic/pull/2401) Upgrade CLI catching for alternative application run types
- [2402](https://github.com/sanic-org/sanic/pull/2402) Conditionally inject CLI arguments into factory
- [2413](https://github.com/sanic-org/sanic/pull/2413) Add new start and stop event listeners to reloader process
- [2414](https://github.com/sanic-org/sanic/pull/2414) Remove loop as required listener arg
- [2415](https://github.com/sanic-org/sanic/pull/2415) Better exception for bad URL parsing
- [sanic-routing47](https://github.com/sanic-org/sanic-routing/pull/47) Add a new extention parameter type: `<file:ext>`, `<file:ext=jpg>`, `<file:ext=jpg|png|gif|svg>`, `<file=int:ext>`, `<file=int:ext=jpg|png|gif|svg>`, `<file=float:ext=tar.gz>`
- 👶 *BETA FEATURE*: This feature will not work with `path` type matching, and is being released as a beta feature only.
- [sanic-routing57](https://github.com/sanic-org/sanic-routing/pull/57) Change `register_pattern` to accept a `str` or `Pattern`
- [sanic-routing58](https://github.com/sanic-org/sanic-routing/pull/58) Default matching on non-empty strings only, and new `strorempty` pattern type
- 🚨 *BREAKING CHANGE*: Previously a route with a dynamic string parameter (`/<foo>` or `/<foo:str>`) would match on any string, including empty strings. It will now **only** match a non-empty string. To retain the old behavior, you should use the new parameter type: `/<foo:strorempty>`.
Bugfixes
- [2373](https://github.com/sanic-org/sanic/pull/2373) Remove `error_logger` on websockets
- [2381](https://github.com/sanic-org/sanic/pull/2381) Fix newly assigned `None` in task registry
- [sanic-routing52](https://github.com/sanic-org/sanic-routing/pull/52) Add type casting to regex route matching
- [sanic-routing60](https://github.com/sanic-org/sanic-routing/pull/60) Add requirements check on regex routes (this resolves, for example, multiple static directories with differing `host` values)
Deprecations and Removals
- [2362](https://github.com/sanic-org/sanic/pull/2362) 22.3 Deprecations and changes
1. `debug=True` and `--debug` do _NOT_ automatically run `auto_reload`
2. Default error render is with plain text (browsers still get HTML by default because `auto` looks at headers)
3. `config` is required for `ErrorHandler.finalize`
4. `ErrorHandler.lookup` requires two positional args
5. Unused websocket protocol args removed
- [2344](https://github.com/sanic-org/sanic/pull/2344) Deprecate loading of lowercase environment variables
Developer infrastructure
- [2363](https://github.com/sanic-org/sanic/pull/2363) Revert code coverage back to Codecov
- [2405](https://github.com/sanic-org/sanic/pull/2405) Upgrade tests for `sanic-routing` changes
- [sanic-testing35](https://github.com/sanic-org/sanic-testing/pull/35) Allow for httpx v0.22
Improved Documentation
- [2350](https://github.com/sanic-org/sanic/pull/2350) Fix link in README for ASGI
- [2398](https://github.com/sanic-org/sanic/pull/2398) Document middleware on_request and on_response
- [2409](https://github.com/sanic-org/sanic/pull/2409) Add missing documentation for `Request.respond`
Miscellaneous
- [2376](https://github.com/sanic-org/sanic/pull/2376) Fix typing for `ListenerMixin.listener`
- [2383](https://github.com/sanic-org/sanic/pull/2383) Clear deprecation warning in `asyncio.wait`
- [2387](https://github.com/sanic-org/sanic/pull/2387) Cleanup `__slots__` implementations
- [2390](https://github.com/sanic-org/sanic/pull/2390) Clear deprecation warning in `asyncio.get_event_loop`
21.12.2
Resolves 2477 and 2478
See also 2495 and https://github.com/sanic-org/sanic/security/advisories/GHSA-8cw9-5hmv-77w6
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v21.12.1...v21.12.2
21.12.1
- [2349](https://github.com/sanic-org/sanic/pull/2349) Only display MOTD on startup
- [2354](https://github.com/sanic-org/sanic/pull/2354) Add config.update support for all config values
- [2355](https://github.com/sanic-org/sanic/pull/2355) Ignore name argument in Python 3.7
21.12.0
Features
- [2260](https://github.com/sanic-org/sanic/pull/2260) Allow early Blueprint registrations to still apply later added objects
- [2262](https://github.com/sanic-org/sanic/pull/2262) Noisy exceptions - force logging of all exceptions
- [2264](https://github.com/sanic-org/sanic/pull/2264) Optional `uvloop` by configuration
- [2270](https://github.com/sanic-org/sanic/pull/2270) Vhost support using multiple TLS certificates
- [2277](https://github.com/sanic-org/sanic/pull/2277) Change signal routing for increased consistency
- *BREAKING CHANGE*: If you were manually routing signals there is a breaking change. The signal router's `get` is no longer 100% determinative. There is now an additional step to loop thru the returned signals for proper matching on the requirements. If signals are being dispatched using `app.dispatch` or `bp.dispatch`, there is no change.
- [2290](https://github.com/sanic-org/sanic/pull/2290) Add contextual exceptions
- [2291](https://github.com/sanic-org/sanic/pull/2291) Increase join concat performance
- [2295](https://github.com/sanic-org/sanic/pull/2295), [#2316](https://github.com/sanic-org/sanic/pull/2316), [#2331](https://github.com/sanic-org/sanic/pull/2331) Restructure of CLI and application state with new displays and more command parity with `app.run`
- [2302](https://github.com/sanic-org/sanic/pull/2302) Add route context at definition time
- [2304](https://github.com/sanic-org/sanic/pull/2304) Named tasks and new API for managing background tasks
- [2307](https://github.com/sanic-org/sanic/pull/2307) On app auto-reload, provide insight of changed files
- [2308](https://github.com/sanic-org/sanic/pull/2308) Auto extend application with [Sanic Extensions](https://sanicframework.org/en/plugins/sanic-ext/getting-started.html) if it is installed, and provide first class support for accessing the extensions
- [2309](https://github.com/sanic-org/sanic/pull/2309) Builtin signals changed to `Enum`
- [2313](https://github.com/sanic-org/sanic/pull/2313) Support additional config implementation use case
- [2321](https://github.com/sanic-org/sanic/pull/2321) Refactor environment variable hydration logic
- [2327](https://github.com/sanic-org/sanic/pull/2327) Prevent sending multiple or mixed responses on a single request
- [2330](https://github.com/sanic-org/sanic/pull/2330) Custom type casting on environment variables
- [2332](https://github.com/sanic-org/sanic/pull/2332) Make all deprecation notices consistent
- [2335](https://github.com/sanic-org/sanic/pull/2335) Allow underscore to start instance names
Bugfixes
- [2273](https://github.com/sanic-org/sanic/pull/2273) Replace assignation by typing for `websocket_handshake`
- [2285](https://github.com/sanic-org/sanic/pull/2285) Fix IPv6 display in startup logs
- [2299](https://github.com/sanic-org/sanic/pull/2299) Dispatch `http.lifecyle.response` from exception handler
Deprecations and Removals
- [2306](https://github.com/sanic-org/sanic/pull/2306) Removal of deprecated items
- `Sanic` and `Blueprint` may no longer have arbitrary properties attached to them
- `Sanic` and `Blueprint` forced to have compliant names
- alphanumeric + `_` + `-`
- must start with letter or `_`
- `load_env` keyword argument of `Sanic`
- `sanic.exceptions.abort`
- `sanic.views.CompositionView`
- `sanic.response.StreamingHTTPResponse`
- *NOTE:* the `stream()` response method (where you pass a callable streaming function) has been deprecated and will be removed in v22.6. You should upgrade all streaming responses to the new style: https://sanicframework.org/en/guide/advanced/streaming.html#response-streaming
- [2320](https://github.com/sanic-org/sanic/pull/2320) Remove app instance from Config for error handler setting
Developer infrastructure
- [2251](https://github.com/sanic-org/sanic/pull/2251) Change dev install command
- [2286](https://github.com/sanic-org/sanic/pull/2286) Change codeclimate complexity threshold from 5 to 10
- [2287](https://github.com/sanic-org/sanic/pull/2287) Update host test function names so they are not overwritten
- [2292](https://github.com/sanic-org/sanic/pull/2292) Fail CI on error
- [2311](https://github.com/sanic-org/sanic/pull/2311), [#2324](https://github.com/sanic-org/sanic/pull/2324) Do not run tests for draft PRs
- [2336](https://github.com/sanic-org/sanic/pull/2336) Remove paths from coverage checks
- [2338](https://github.com/sanic-org/sanic/pull/2338) Cleanup ports on tests
Improved Documentation
- [2269](https://github.com/sanic-org/sanic/pull/2269), [#2329](https://github.com/sanic-org/sanic/pull/2329), [#2333](https://github.com/sanic-org/sanic/pull/2333) Cleanup typos and fix language
Miscellaneous
- [2257](https://github.com/sanic-org/sanic/pull/2257), [#2294](https://github.com/sanic-org/sanic/pull/2294), [#2341](https://github.com/sanic-org/sanic/pull/2341) Add Python 3.10 support
- [2279](https://github.com/sanic-org/sanic/pull/2279), [#2317](https://github.com/sanic-org/sanic/pull/2317), [#2322](https://github.com/sanic-org/sanic/pull/2322) Add/correct missing type annotations
- [2305](https://github.com/sanic-org/sanic/pull/2305) Fix examples to use modern implementations
21.9.3
_Rerelease of v21.9.2 with some cleanup_
21.9.2
- 2268 Make HTTP connections start in IDLE stage, avoiding delays and error messages
- 2310 More consistent config setting with post-FALLBACK_ERROR_FORMAT apply
21.9.1
- 2259 Allow non-conforming ErrorHandlers
21.9
[Release Notes](https://sanicframework.org/en/guide/release-notes/v21.9.html)
Features
- [2158](https://github.com/sanic-org/sanic/pull/2158), [#2248](https://github.com/sanic-org/sanic/pull/2248) Complete overhaul of I/O to websockets
- [2160](https://github.com/sanic-org/sanic/pull/2160) Add new 17 signals into server and request lifecycles
- [2162](https://github.com/sanic-org/sanic/pull/2162) Smarter `auto` fallback formatting upon exception
- [2184](https://github.com/sanic-org/sanic/pull/2184) Introduce implementation for copying a Blueprint
- [2200](https://github.com/sanic-org/sanic/pull/2200) Accept header parsing
- [2207](https://github.com/sanic-org/sanic/pull/2207) Log remote address if available
- [2209](https://github.com/sanic-org/sanic/pull/2209) Add convenience methods to BP groups
- [2216](https://github.com/sanic-org/sanic/pull/2216) Add default messages to SanicExceptions
- [2225](https://github.com/sanic-org/sanic/pull/2225) Type annotation convenience for annotated handlers with path parameters
- [2236](https://github.com/sanic-org/sanic/pull/2236) Allow Falsey (but not-None) responses from route handlers
- [2238](https://github.com/sanic-org/sanic/pull/2238) Add `exception` decorator to Blueprint Groups
- [2244](https://github.com/sanic-org/sanic/pull/2244) Explicit static directive for serving file or dir (ex: `static(..., resource_type="file")`)
- [2245](https://github.com/sanic-org/sanic/pull/2245) Close HTTP loop when connection task cancelled
Bugfixes
- [2188](https://github.com/sanic-org/sanic/pull/2188) Fix the handling of the end of a chunked request
- [2195](https://github.com/sanic-org/sanic/pull/2195) Resolve unexpected error handling on static requests
- [2208](https://github.com/sanic-org/sanic/pull/2208) Make blueprint-based exceptions attach and trigger in a more intuitive manner
- [2211](https://github.com/sanic-org/sanic/pull/2211) Fixed for handling exceptions of asgi app call
- [2213](https://github.com/sanic-org/sanic/pull/2213) Fix bug where ws exceptions not being logged
- [2231](https://github.com/sanic-org/sanic/pull/2231) Cleaner closing of tasks by using `abort()` in strategic places to avoid dangling sockets
- [2247](https://github.com/sanic-org/sanic/pull/2247) Fix logging of auto-reload status in debug mode
- [2246](https://github.com/sanic-org/sanic/pull/2246) Account for BP with exception handler but no routes
Developer infrastructure
- [2194](https://github.com/sanic-org/sanic/pull/2194) HTTP unit tests with raw client
- [2199](https://github.com/sanic-org/sanic/pull/2199) Switch to codeclimate
- [2214](https://github.com/sanic-org/sanic/pull/2214) Try Reopening Windows Tests
- [2229](https://github.com/sanic-org/sanic/pull/2229) Refactor `HttpProtocol` into a base class
- [2230](https://github.com/sanic-org/sanic/pull/2230) Refactor `server.py` into multi-file module
Miscellaneous
- [2173](https://github.com/sanic-org/sanic/pull/2173) Remove Duplicated Dependencies and PEP 517 Support
- [2193](https://github.com/sanic-org/sanic/pull/2193), [#2196](https://github.com/sanic-org/sanic/pull/2196), [#2217](https://github.com/sanic-org/sanic/pull/2217) Type annotation changes
21.6.2
Bugfixes
- 2211 Fix handling of exceptions in ASGI app call
21.6.1
Bugfixes
- 2178 Update `sanic-routing` to allow for better splitting of complex URI templates
- 2183 Proper handling of chunked request bodies to resolve phantom 503 in logs
- 2181 Resolve regression in exception logging
- 2201 Cleanup request info in pipelined requests
21.6.0
Features
- 2094 Add `response.eof()` method for closing a stream in a handler
- 2097 Allow case-insensitive HTTP Upgrade header
- 2104 Explicit usage of `CIMultiDict` getters
- 2109 Consistent use of error loggers
- 2114 New `client_ip` access of connection info instance
- 2119 Alternatate classes on instantiation for `Config` and `Sanic.ctx`
- 2133 Implement new version of AST router
- Proper differentiation between `alpha` and `string` param types
- Adds a `slug` param type, example: `<foo:slug>`
- Deprecates `<foo:string>` in favor of `<foo:str>`
- Deprecates `<foo:number>` in favor of `<foo:float>`
- Adds a `route.uri` accessor
- 2136 CLI improvements with new optional params
- 2137 Add version_prefix to URL builders
- 2140 Event autoregistration with `EVENT_AUTOREGISTER`
- 2146, 2147 Require stricter names on `Sanic()` and `Blueprint()`
- 2150 Infinitely reusable and nestable `Blueprint` and `BlueprintGroup`
- 2154 Upgrade websockets dependency to min version
- 2155 Allow for maximum header sizes to be increased: `REQUEST_MAX_HEADER_SIZE`
- 2157 Allow app factory pattern in CLI
- 2165 Change HTTP methods to enums
- 2167 Allow auto-reloading on additional directories
- 2168 Add simple HTTP server to CLI
- 2170 Additional methods for attaching `HTTPMethodView`
Bugfixes
- 2091 Fix UserWarning in ASGI mode for missing `__slots__`
- 2099 Fix static request handler logging exception on 404
- 2110 Fix `request.args.pop` removes parameters inconsistently
- 2107 Fix type hinting for `load_env`
- 2127 Make sure ASGI ws subprotocols is a list
- 2128 Fix issue where Blueprint exception handlers do not consistently route to proper handler
Deprecations and Removals
- 2156 Remove config value `REQUEST_BUFFER_QUEUE_SIZE`
- 2170 `CompositionView` deprecated and marked for removal in 21.12
- 2172 Deprecate `StreamingHTTPResponse`
Developer infrastructure
- 2149 Remove Travis CI in favor of GitHub Actions
Improved Documentation
- 2164 Fix typo in documentation
- 2100 Remove documentation for non-existent arguments
21.3.4
Bugfixes
2117 Add `sanic-routing==0.6` with `RouteGroup` and resolve:
- 2116 Access logs not properly displaying body size
- 2103 Request body not automatically loading
- 2101 ASGI routes not extracting body
- 2090 Edge case on router with overloading
21.3.3
*NO RELEASE*
21.3.2
Bugfixes
* 2081 Disable response timeout on websocket connections
* 2085 Make sure that blueprints with no slash is maintained when applied
21.3.1
Bugfixes
* [2076](https://github.com/sanic-org/sanic/pull/2076) Static files inside subfolders are not accessible (404)
21.3.0
[Release Notes](https://sanicframework.org/en/guide/release-notes/v21.3.html)
Features
* [1876](https://github.com/sanic-org/sanic/pull/1876) Unified streaming server
* [2005](https://github.com/sanic-org/sanic/pull/2005) New `Request.id` property
* [2008](https://github.com/sanic-org/sanic/pull/2008) Allow Pathlib Path objects to be passed to `app.static()` helper
* [2010](https://github.com/sanic-org/sanic/pull/2010) [#2031](https://github.com/sanic-org/sanic/pull/2031) New startup-optimized router
* [2018](https://github.com/sanic-org/sanic/pull/2018) [#2064](https://github.com/sanic-org/sanic/pull/2064) Listeners for main server process
* [2032](https://github.com/sanic-org/sanic/pull/2032) Add raw header info to request object
* [2042](https://github.com/sanic-org/sanic/pull/2042) [#2060](https://github.com/sanic-org/sanic/pull/2060) [#2061](https://github.com/sanic-org/sanic/pull/2061) Introduce Signals API
* [2043](https://github.com/sanic-org/sanic/pull/2043) Add `__str__` and `__repr__` to Sanic and Blueprint
* [2047](https://github.com/sanic-org/sanic/pull/2047) Enable versioning and strict slash on BlueprintGroup
* [2053](https://github.com/sanic-org/sanic/pull/2053) Make `get_app` name argument optional
* [2055](https://github.com/sanic-org/sanic/pull/2055) JSON encoder change via app
* [2063](https://github.com/sanic-org/sanic/pull/2063) App and connection level context objects
Bugfixes and issues resolved
* Resolve [1420](https://github.com/sanic-org/sanic/pull/1420) `url_for` where `strict_slashes` are on for a path ending in `/`
* Resolve [1525](https://github.com/sanic-org/sanic/pull/1525) Routing is incorrect with some special characters
* Resolve [1653](https://github.com/sanic-org/sanic/pull/1653) ASGI headers in body
* Resolve [1722](https://github.com/sanic-org/sanic/pull/1722) Using curl in chunk mode
* Resolve [1730](https://github.com/sanic-org/sanic/pull/1730) Extra content in ASGI streaming response
* Resolve [1749](https://github.com/sanic-org/sanic/pull/1749) Restore broken middleware edge cases
* Resolve [1785](https://github.com/sanic-org/sanic/pull/1785) [#1804](https://github.com/sanic-org/sanic/pull/1804) Synchronous error handlers
* Resolve [1790](https://github.com/sanic-org/sanic/pull/1790) Protocol errors did not support async error handlers #1790
* Resolve [1824](https://github.com/sanic-org/sanic/pull/1824) Timeout on specific methods
* Resolve [1875](https://github.com/sanic-org/sanic/pull/1875) Response timeout error from all routes after returning several timeouts from a specific route
* Resolve [1988](https://github.com/sanic-org/sanic/pull/1988) Handling of safe methods with body
- [2001](https://github.com/sanic-org/sanic/pull/2001) Raise ValueError when cookie max-age is not an integer
Deprecations and Removals
* [2007](https://github.com/sanic-org/sanic/pull/2007)
* Config using `from_envvar`
* Config using `from_pyfile`
* Config using `from_object`
* [2009](https://github.com/sanic-org/sanic/pull/2009) Remove Sanic test client to its own package
* [2036](https://github.com/sanic-org/sanic/pull/2036) [#2037](https://github.com/sanic-org/sanic/pull/2037) Drop Python 3.6 support
* `Request.endpoint` deprecated in favor of `Request.name`
* handler type name prefixes removed (static, websocket, etc)
Developer infrastructure
* [1995](https://github.com/sanic-org/sanic/pull/1995) Create FUNDING.yml
* [2013](https://github.com/sanic-org/sanic/pull/2013) Add codeql to CI pipeline
* [2038](https://github.com/sanic-org/sanic/pull/2038) Codecov configuration updates
* [2049](https://github.com/sanic-org/sanic/pull/2049) Updated setup.py to use `find_packages`
Improved Documentation
* [1218](https://github.com/sanic-org/sanic/pull/1218) Documentation for sanic.log.\* is missing
* [1608](https://github.com/sanic-org/sanic/pull/1608) Add documentation on calver and LTS
* [1731](https://github.com/sanic-org/sanic/pull/1731) Support mounting application elsewhere than at root path
* [2006](https://github.com/sanic-org/sanic/pull/2006) Upgraded type annotations and improved docstrings and API documentation
* [2052](https://github.com/sanic-org/sanic/pull/2052) Fix some examples and docs
Miscellaneous
* `Request.route` property
* Better websocket subprotocols support
* Resolve bug with middleware in Blueprint Group when passed callable
* Moves common logic between Blueprint and Sanic into mixins
* Route naming changed to be more consistent
* request endpoint is the route name
* route names are fully namespaced
* Some new convenience decorators:
* `app.main_process_start`
* `app.main_process_stop`
* `app.before_server_start`
* `app.after_server_start`
* `app.before_server_stop`
* `app.after_server_stop`
* `app.on_request`
* `app.on_response`
* Fixes `Allow` header that did not include `HEAD`
* Using "name" keyword in `url_for` for a "static" route where name does not exist
* Cannot have multiple `app.static()` without using the named param
* Using "filename" keyword in `url_for` on a file route
* `unquote` in route def (not automatic)
* `routes_all` is tuples
* Handler arguments are kwarg only
* `request.match_info` is now a cached (and not computed) property
* Unknown static file mimetype is sent as `application/octet-stream`
* `_host` keyword in `url_for`
* Add charset default to `utf-8` for text and js content types if not specified
* Version for a route can be str, float, or int
* Route has ctx property
* App has `routes_static`, `routes_dynamic`, `routes_regex`
* [2044](https://github.com/sanic-org/sanic/pull/2044) Code cleanup and refactoring
* [2072](https://github.com/sanic-org/sanic/pull/2072) Remove `BaseSanic` metaclass
* [2074](https://github.com/sanic-org/sanic/pull/2074) Performance adjustments in `handle_request_`
20.12.7
Resolves 2477 and 2478
See also 2495 and https://github.com/sanic-org/sanic/security/advisories/GHSA-8cw9-5hmv-77w6
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v20.12.6...v20.12.7
20.12.6
What's Changed
* Potential server crash if running Python 3.10 w/ Sanic 20.12 by ahopkins in https://github.com/sanic-org/sanic/pull/2400
**Full Changelog**: https://github.com/sanic-org/sanic/compare/v20.12.5...v20.12.6
20.12.5
2366 Upgrade `websockets` version - **SECURITY UPDATE**
20.12.4
- 2129 Unpin uvloop
20.12.3
Bugfixes
* [2021](https://github.com/sanic-org/sanic/pull/2021) Remove prefix from websocket handler name
20.12.2
Dependencies
- 2026 Fix uvloop to 0.14 because 0.15 drops Python 3.6 support
- 2029 Remove old chardet requirement, add in hard multidict requirement
20.12.1
Features
- 1993 Add disable app registry
20.12.0
Features
- [\1945][] Static route more verbose if file not found
- [\1954][] Fix static routes registration on a blueprint
- [\1961][] Add Python 3.9 support
- [\1962][] Sanic CLI upgrade
- [\1967][] Update aiofile version requirements
- [\1969][] Update multidict version requirements
- [\1970][] Add py.typed file
- [\1972][] Speed optimization in request handler
- [\1979][] Add app registry and Sanic class level app retrieval
Bugfixes
- [\1965][] Fix Chunked Transport-Encoding in ASGI streaming
response
Deprecations and Removals
- [\1981][] Cleanup and remove deprecated code
Developer infrastructure
- [\1956][] Fix load module test
- [\1973][] Transition Travis from .org to .com
- [\1986][] Update tox requirements
Improved Documentation
- [\1951][] Documentation improvements
- [\1983][] Remove duplicate contents in testing.rst
- [\1984][] Fix typo in routing.rst
[\1945]: https://github.com/huge-success/sanic/pull/1945
[\1954]: https://github.com/huge-success/sanic/pull/1954
[\1961]: https://github.com/huge-success/sanic/pull/1961
[\1962]: https://github.com/huge-success/sanic/pull/1962
[\1967]: https://github.com/huge-success/sanic/pull/1967
[\1969]: https://github.com/huge-success/sanic/pull/1969
[\1970]: https://github.com/huge-success/sanic/pull/1970
[\1972]: https://github.com/huge-success/sanic/pull/1972
[\1979]: https://github.com/huge-success/sanic/pull/1979
[\1965]: https://github.com/huge-success/sanic/pull/1965
[\1981]: https://github.com/huge-success/sanic/pull/1981
[\1956]: https://github.com/huge-success/sanic/pull/1956
[\1973]: https://github.com/huge-success/sanic/pull/1973
[\1986]: https://github.com/huge-success/sanic/pull/1986
[\1951]: https://github.com/huge-success/sanic/pull/1951
[\1983]: https://github.com/huge-success/sanic/pull/1983
[\1984]: https://github.com/huge-success/sanic/pull/1984
20.9.1
Bugfixes
* [1957](https://github.com/huge-success/sanic/pull/1957) Removes duplicate headers in ASGI streaming body
* [1954](https://github.com/huge-success/sanic/pull/1954) Fix static route registration on blueprints
20.9.0
Features
* [1887](https://github.com/huge-success/sanic/pull/1887) Pass subprotocols in websockets (both sanic server and ASGI)
* [1894](https://github.com/huge-success/sanic/pull/1894) Automatically set `test_mode` flag on app instance
* [1903](https://github.com/huge-success/sanic/pull/1903) Add new unified method for updating app values
* [1906](https://github.com/huge-success/sanic/pull/1906), [#1909](https://github.com/huge-success/sanic/pull/1909) Adds WEBSOCKET_PING_TIMEOUT and WEBSOCKET_PING_INTERVAL configuration values
* [1935](https://github.com/huge-success/sanic/pull/1935) httpx version dependency updated, it is slated for removal as a dependency in v20.12
* [1937](https://github.com/huge-success/sanic/pull/1937) Added auto, text, and json fallback error handlers (in v21.3, the default will change form html to auto)
Bugfixes
* [1897](https://github.com/huge-success/sanic/pull/1897) Resolves exception from unread bytes in stream
Deprecations and Removals
* [1903](https://github.com/huge-success/sanic/pull/1903) config.from_envar, config.from_pyfile, and config.from_object are deprecated and set to be removed in v21.3
Developer infrastructure
* [1890](https://github.com/huge-success/sanic/pull/1890), [#1891](https://github.com/huge-success/sanic/pull/1891) Update isort calls to be compatible with new API
* [1893](https://github.com/huge-success/sanic/pull/1893) Remove version section from setup.cfg
* [1924](https://github.com/huge-success/sanic/pull/1924) Adding --strict-markers for pytest
Improved Documentation
* [1922](https://github.com/huge-success/sanic/pull/1922) Add explicit ASGI compliance to the README
20.6.3
Bugfixes
* [1884](https://github.com/huge-success/sanic/pull/1884) Socket binding implemented properly for IPv6 and UNIX sockets
20.6.2
Features
* [1641](https://github.com/huge-success/sanic/pull/1641) Socket binding implemented properly for IPv6 and UNIX sockets
20.6.1
Features
* [1760](<https://github.com/huge-success/sanic/pull/1760>) Add version parameter to websocket routes
* [1866](<https://github.com/huge-success/sanic/pull/1866>) Add ``sanic`` as an entry point command
* [1880](<https://github.com/huge-success/sanic/pull/1880>) Add handler names for websockets for url_for usage
Bugfixes
* [1776](<https://github.com/huge-success/sanic/pull/1776>) Bug fix for host parameter issue with lists
* [1842](<https://github.com/huge-success/sanic/pull/1842>) Fix static _handler pickling error
* [1827](<https://github.com/huge-success/sanic/pull/1827>) Fix reloader on OSX py38 and Windows
* [1848](<https://github.com/huge-success/sanic/pull/1848>) Reverse named_response_middlware execution order, to match normal response middleware execution order
* [1853](<https://github.com/huge-success/sanic/pull/1853>) Fix pickle error when attempting to pickle an application which contains websocket routes
Deprecations and Removals
* [1739](<https://github.com/huge-success/sanic/pull/1739>) Deprecate body_bytes to merge into body
Developer infrastructure
* [1852](<https://github.com/huge-success/sanic/pull/1852>) Fix naming of CI test env on Python nightlies
* [1857](<https://github.com/huge-success/sanic/pull/1857>) Adjust websockets version to setup.py
* [1869](<https://github.com/huge-success/sanic/pull/1869>) Wrap run()'s "protocol" type annotation in Optional[]
Improved Documentation
* [1846](<https://github.com/huge-success/sanic/pull/1846>) Update docs to clarify response middleware execution order
* [1865](<https://github.com/huge-success/sanic/pull/1865>) Fixing rst format issue that was hiding documentation
20.3.0
ChangeLogs: https://github.com/huge-success/sanic/blob/master/CHANGELOG.rst#version-2030
19.12.5
Dependencies
- 2025 Fix uvloop to 0.14 because 0.15 drops Python 3.6 support
- 2027 Remove old chardet requirement, add in hard multidict requirement
19.12.3
Bugfixes
* [1959](https://github.com/huge-success/sanic/pull/1959) Removes duplicate headers in ASGI streaming body
19.12.2
Resolve forgotten slot, see 1743
19.12.0
Major changes to bring sanic up to current. Please consult the changelog. There are breaking changes in this release; please continue to use 19.9.X or the previous 18.12.X LTS release which will continued to be supported until December 2021 for stability.
19.6.0
Sanic 19.6.0 is a standard release based on the CalVer versioning adopted in 2018.
**Changes:**
1475 ASGI support (Beta)
1436 Add Configure support from object string
1544 Drop dependency on distutil
1562 Switch to use request-async for test_client from aiohttp
**Fixes:**
1587 Add missing handler for Expect header.
1560 Allow to disable Transfer-Encoding: chunked.
1558 Fix graceful shutdown.
1594 Fix strict slashes behavior.
**Deprecations:**
1568 Deprecate route removal.
1562 Drop Python3.5 support.
19.03.1
A re-do of the 19.03 release
19.3
Sanic 19.3 is a standard release based on the CalVer versioning adopted in 2018.
**Changes:**
1502 Remove current_time prefetch
1499 Add Route Resolution Benchmarking to Unit Test
1497 Recognizes non-ASCII filenames in RFC 2231, and suport filename length is zero for multipart/form-data.
1489 Added "databases" (documentation)
1487 Remove deleted repo from extensions list
1484 Enforce Datetime Type for Expires on Set-Cookie
1483 Add sanic-zipkin to extensions list
1482 Add stream support for bp.add_route()
1481 Allow negative int/number in path
1478 Upgrade setuptools version and use native docutils in doc build
1472 Remove unwanted None check for __repr__ in `Request` class
1470 make Sanic.create_server return an asyncio.Server
**Fixes:**
1516 Fix typo at the exception documentation
1515 fix linter issue causing travis build failures (fix 1514)
1510 fix typo in Asyncio example
1501 Fix the auto_reloader to work when the executable was launched with a module
1490 Fix python version in doc build
1486 did you mean specific? (documentation typo)
1477 Fix grammar in README.md
1476 add Request.not_grouped_args, deprecation warning Request.raw_args deprecation idea discussion
1464 Upgrade pytest, and fix caplog unit tests
18.12.0
- Changes:
- Improved codebase test coverage from 81% to 91%.
- Added stream_large_files and host examples in static_file document
- Added methods to append and finish body content on Request (1379)
- Integrated with .appveyor.yml for windows ci support
- Added documentation for AF_INET6 and AF_UNIX socket usage
- Adopt black/isort for codestyle
- Cancel task when connection_lost
- Simplify request ip and port retrieval logic
- Handle config error in load config file.
- Integrate with codecov for CI
- Add missed documentation for config section.
- Deprecate Handler.log
- Pinned httptools requirement to version 0.0.10+
- Fixes:
- Fix `remove_entity_headers` helper function (1415)
- Fix TypeError when use Blueprint.group() to group blueprint with default url_prefix, Use os.path.normpath to avoid invalid url_prefix like api//v1
f8a6af1 Rename the `http` module to `helpers` to prevent conflicts with the built-in Python http library (fixes 1323)
- Fix unittests on windows
- Fix Namespacing of sanic logger
- Fix missing quotes in decorator example
- Fix redirect with quoted param
- Fix doc for latest blueprint code
- Fix build of latex documentation relating to markdown lists
- Fix loop exception handling in app.py
- Fix content length mismatch in windows and other platform
- Fix Range header handling for static files (1402)
- Fix the logger and make it work (1397)
- Fix type pikcle->pickle in multiprocessing test
- Fix pickling blueprints Change the string passed in the "name" section of the namedtuples in Blueprint to matc