L. Kärkkäinen
9651e6ae01
Remove StreamingHTTPResponse.get_headers helper function.
2020-01-15 11:27:26 +02:00
L. Kärkkäinen
7704814019
Merge remote-tracking branch 'upstream/master' into bodybytes
2020-01-15 10:53:48 +02:00
Ashley Sommer
b565072ed9
Allow route decorators to stack up again ( #1764 )
...
* Allow route decorators to stack up without causing a function signature inspection crash
Fix #1742
* Apply fix to @websocket routes docorator too
Add test for double-stacked websocket decorator
remove introduction of new variable in route wrapper, extend routes in-place.
Add explanation of why a handler will be a tuple in the case of a double-stacked route decorator
2020-01-10 21:50:16 -08:00
Ashley Sommer
caa1b4d69b
Fix dangling comma in arguments list for HTTPResponse in response.empty() ( #1761 )
...
* Fix dangling comma arguments list for HTTPResponse in response.empty()
* Found another black error, including another dangling comma
2020-01-10 19:58:01 -08:00
Liran Nuna
865536c5c4
Simplify status code to text lookup ( #1738 )
2020-01-10 08:43:44 -06:00
Eli Uriegas
784d5cce52
Merge pull request #1755 from Lagicrus/empty-response
...
Update docs
2020-01-04 19:15:24 -08:00
Lagicrus
0fd08c6114
Update response.rst
2020-01-04 21:26:03 +00:00
Lagicrus
cd779b6e4f
Update response.rst
2020-01-04 19:51:50 +00:00
好风
3430907046
fix 1748 : Drop DeprecationWarning in python 3.8 ( #1750 )
...
https://github.com/huge-success/sanic/issues/1748
2020-01-03 20:20:42 -08:00
Eli Uriegas
2f776eba85
Release v19.12.0 ( #1747 )
...
Release v19.12.0
2020-01-03 11:50:33 -08:00
Adam Hopkins
b9cd2ed1f1
Merge pull request #1751 from huge-success/master
...
Move Release into LTS Branch
2020-01-02 23:45:08 +02:00
Adam Hopkins
850b63f642
Merge pull request #1743 from eric-nieuwland/master
...
Forgotten slot
2020-01-02 23:17:35 +02:00
Eric Nieuwland
a9c669f17b
Forgotten slot
...
Crashes the server at __init__() time
2019-12-28 15:21:27 +01:00
Stephen Sadowski
075affec23
Release v19.12.0 ( #1740 )
...
* Bumping up version from 19.9.0 to 19.12.0
* Pipfile crud removed
2019-12-27 07:10:46 -06:00
Stephen Sadowski
3411a12c40
Pipfile crud removed
2019-12-26 18:50:52 -06:00
Stephen Sadowski
28899356c8
Bumping up version from 19.12.0 to 19.12.0
2019-12-26 18:47:56 -06:00
Eli Uriegas
2b5f8d20de
ci: Add python nightlies to test matrix ( #1710 )
...
Signed-off-by: Eli Uriegas <seemethere101@gmail.com>
2019-12-25 16:50:31 -08:00
Adam Hopkins
243f240e5f
Add RFC
labels to stale exclusion list ( #1737 )
2019-12-23 17:31:33 -06:00
L. Kärkkäinen
0a25868a86
HTTP1 header formatting moved to headers.format_headers and rewritten. ( #1669 )
...
* HTTP1 header formatting moved to headers.format_headers and rewritten.
- New implementation is one line of code and twice faster than the old one.
- Whole header block encoded to UTF-8 in one pass.
- No longer supports custom encode method on header values.
- Cookie objects now have __str__ in addition to encode, to work with this.
* Add an import missed in merge.
2019-12-23 17:30:45 -06:00
Liran Nuna
fccbc1adc4
Allow empty body without Content-Type; Introduce response.empty() ( #1736 )
2019-12-23 14:16:53 -06:00
Adam Hopkins
3f6a978328
Swap out requests-async for httpx ( #1728 )
...
* Begin swap of requests-async for httpx
* Finalize httpx adoption and resolve tests
Resolve linting and formatting
* Remove documentation references to requests-async in favor of httpx
2019-12-20 19:23:52 -08:00
Harsha Narayana
a6077a1790
GIT-37: fix blueprint middleware application ( #1690 )
...
* GIT-37: fix blueprint middleware application
1. If you register a middleware via `@blueprint.middleware` then it will apply only to the routes defined by the blueprint.
2. If you register a middleware via `@blueprint_group.middleware` then it will apply to all blueprint based routes that are part of the group.
3. If you define a middleware via `@app.middleware` then it will be applied on all available routes
Fixes #37
Signed-off-by: Harsha Narayana <harsha2k4@gmail.com>
* GIT-37: add changelog
Signed-off-by: Harsha Narayana <harsha2k4@gmail.com>
2019-12-20 10:01:04 -06:00
Eli Uriegas
179a07942e
Merge pull request #1734 from seemethere/testing_host
...
testing: Add host argument to SanicTestClient
2019-12-18 16:50:59 -08:00
Eli Uriegas
c3aed01096
testing: Add host argument to SanicTestClient
...
Adds the ability to specify a host argument when using the
SanicTestClient.
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
2019-12-18 16:31:38 -08:00
7
028778ed56
Fix #1714 ( #1716 )
...
* fix abort call errors out when calling inside stream handler
* handle pending task properly after cleanup
2019-12-16 09:46:18 -06:00
L. Kärkkäinen
3967faf44e
Add html test for __html__ and _repr_html_.
2019-12-15 18:40:25 +02:00
L. Kärkkäinen
eb349fe5b5
Add an empty line to make isort happy.
2019-12-15 14:07:07 +02:00
L. Kärkkäinen
6cfd764084
Workaround MyPy issue.
2019-12-15 14:05:48 +02:00
L. Kärkkäinen
347fd96e72
Merge remote-tracking branch 'upstream/master' into bodybytes
2019-12-15 13:44:58 +02:00
Adam Bannister
2d72874b0b
Add return type to Sanic.create_server for type hinting and docs ( #1724 )
...
* add type hint and doc when create_server returns AsyncioServer
* fix linting
2019-12-12 10:25:13 -06:00
Seonghyeon Kim
4c45d30400
FIX: invalid rst syntax ( #1727 )
2019-12-12 10:24:11 -06:00
Junyeong Jeong
ecbe5c839f
pass request_buffer_queue_size argument to HttpProtocol ( #1717 )
...
* pass request_buffer_queue_size argument to HttpProtocol
* fix to use simultaneously only one task to put body to stream buffer
* add a test code for REQUEST_BUFFER_QUEUE_SIZE
2019-11-21 09:33:50 -06:00
Vinícius Dantas
ed1f367a8a
Reduce nesting for the sample authentication decorator ( #1715 )
...
* Reduce nesting for the sample authentication decorator
* Add missing decorator argument
2019-11-14 14:57:41 -06:00
Lagicrus
a4185a0ba7
Doc rework ( #1698 )
...
* blueprints
* class_based_views
* config
* decorators
* deploying
* exceptions
* extensions
* getting_started
* middleware
* request_data
* response
* routing
* static_files
* streaming
* testing
* versioning
* Fix bug and links
* spelling mistakes
* Bug fixes and minor tweaks
* Create 1691.doc.rst
* Bug fixes and tweaks
Co-Authored-By: Harsha Narayana <harsha2k4@gmail.com>
2019-11-14 14:11:38 -06:00
Harsha Narayana
e81a8ce073
fix SERVER_NAME enforcement in url_for and request.args documentation ( #1708 )
...
* 🐛 fix SERVER_NAME enforcement in url_for
fixes #1707
* 💡 add additional documentation for using request.args
fixes #1704
* ✅ add additional test to check url_for without SERVER_NAME
* 📝 add changelog for fixes
2019-11-01 10:32:49 -07:00
Harsha Narayana
e506c89304
deprecate None value support for app name ( #1705 )
...
* ➖ deprecate None value support for app name
* 🚨 cleanup linter issues across the codebase
2019-10-23 09:12:20 -07:00
Bruno Oliveira
fcdc9c83c5
Add 'python_requires' key to setup.py ( #1701 )
...
This key is important so that `pip` doesn't try to install `sanic` in unsupported Python versions:
https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires
2019-10-14 21:17:05 -07:00
7
be0d539746
19.9.0 release ( #1699 )
2019-10-12 09:54:47 -05:00
Lagicrus
4f9739ed2c
Update helpers.py ( #1693 )
2019-10-08 16:29:03 -07:00
Lagicrus
0df37fa653
Update websocket.rst ( #1694 )
2019-10-08 16:28:09 -07:00
Eli Uriegas
3e932505b0
Bump up pytest version for fixing ci build ( #1689 )
...
Bump up pytest version for fixing ci build
2019-10-08 14:32:38 -07:00
Yun Xu
01be691936
misc: bump up pytest version for fixing ci build
2019-10-07 11:41:44 -07:00
Simon
134c414fe5
Support websockets 8.x as well as 7.x ( #1687 )
...
Sanic currently requires websockets 7.x, but it's straightforward to
also support the more recent 8.x.
2019-10-01 23:03:09 -07:00
L. Kärkkäinen
c54a8b10bb
Implement dict-like API on request objects for custom data. ( #1666 )
...
* Implement dict-like API on request objects for custom data.
* Updated docs about custom_context.
2019-09-26 14:11:31 -07:00
Vinícius Dantas
6fc3381229
Add a type checking pipeline ( #1682 )
...
* Integrate with mypy
2019-09-22 13:55:36 -07:00
Ashley Sommer
927c0e082e
Fix tests for multiprocessing pickle app and pickle blueprint ( #1680 )
...
The old tests were not quite checking for the right thing.
Fixing the test does not change Sanic code, expose any bugs, or fix any bugs.
2019-09-18 10:22:24 -07:00
Ashley Sommer
7674e917e4
Fixes "after_server_start" when using return_asyncio_server. ( #1676 )
...
* Fixes ability to trigger "after_server_start", "before_server_stop", "after_server_stop" server events when using app.create_server to start your own asyncio_server
See example file run_async_advanced for a full example
* Fix a missing method on AsyncServer that some tests need
Add a tiny bit more documentation in-code
Change name of AsyncServerCoro to AsyncioServer
2019-09-16 10:59:16 -07:00
ku-mu
e13f42c17b
Fix docstring style in Sanic.register_listener ( #1678 )
...
* Fix docstring style: google -> reST
2019-09-16 10:27:22 -07:00
Lagicrus
b7d4121586
Update static_files.md ( #1672 )
2019-09-11 14:37:14 -07:00
L. Kärkkäinen
6d1996c449
<any type>-to-str response autoconversion limited to sanic.response.text() only.
2019-09-11 12:24:33 +03:00