Currently, any blueprint middleware registered, irrespective of which blueprint was used to do so, was
being applied to all of the routes created by the :code:`@app` and :code:`@blueprint` alike.
As part of this change, the blueprint based middleware application is enforced based on where they are
registered.
- If you register a middleware via :code:`@blueprint.middleware` then it will apply only to the routes defined by the blueprint.
- If you register a middleware via :code:`@blueprint_group.middleware` then it will apply to all blueprint based routes that are part of the group.
- If you define a middleware via :code:`@app.middleware` then it will be applied on all available routes (`#37 <https://github.com/huge-success/sanic/issues/37>`__)
- Fix `url_for` behavior with missing SERVER_NAME
If the `SERVER_NAME` was missing in the `app.config` entity, the `url_for` on the `request` and `app` were failing
due to an `AttributeError`. This fix makes the availability of `SERVER_NAME` on our `app.config` an optional behavior. (`#1707 <https://github.com/huge-success/sanic/issues/1707>`__)
Moved all docs from markdown to restructured text like the rest of the docs to unify the scheme and make it easier in
the future to update documentation. (`#1691 <https://github.com/huge-success/sanic/issues/1691>`__)
- Fix documentation for `get` and `getlist` of the `request.args`
Add additional example for showing the usage of `getlist` and fix the documentation string for `request.args` behavior (`#1704 <https://github.com/huge-success/sanic/issues/1704>`__)
As part of this feature, `towncrier` is being introduced as a mechanism to partially automate the process
of generating and managing change logs as part of each of pull requests. (`#1631 <https://github.com/huge-success/sanic/issues/1631>`__)
Improved Documentation
**********************
- Documentation infrastructure changes
- Enable having a single common `CHANGELOG` file for both GitHub page and documentation
- Fix Sphinix deprecation warnings
- Fix documentation warnings due to invalid `rst` indentation
- Enable common contribution guidelines file across GitHub and documentation via `CONTRIBUTING.rst` (`#1631 <https://github.com/huge-success/sanic/issues/1631>`__)
Note: 19.3.0 was skipped for packagement purposes and not released on PyPI
Version 18.12
=============
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 match the name of the Blueprint module attribute name. This allows blueprints to be pickled and unpickled, without errors, which is a requirment of running Sanic in multiprocessing mode in Windows. Added a test for pickling and unpickling blueprints Added a test for pickling and unpickling sanic itself Added a test for enabling multiprocessing on an app with a blueprint (only useful to catch this bug if the tests are run on Windows).