2569 Commits

Author SHA1 Message Date
Zhiwei Liang
0c2d3ec4bf Fix 2021-08-09 15:05:12 -05:00
Zhiwei Liang
903de13c97 Add version_prefix override test 2021-08-09 12:24:11 -05:00
Zhiwei Liang
e04cd750c5 Add more attrs check in test cases 2021-08-09 02:57:58 -05:00
Zhiwei
9089c794fd
Merge branch 'main' into zhiwei/bp-copy 2021-08-09 02:46:28 -05:00
Zhiwei Liang
4ebb773e1a Update copy blueprint tests 2021-08-09 02:46:04 -05:00
Zhiwei Liang
fb41b3e0b2 call reset at the beginning 2021-08-08 13:40:59 -05:00
YongChan Cho
08c5689441
Style: add type hints (#2217)
* style(routes): add_route argument, return typing

* style(listeners): typing

* style(views): typing as_view

* style(routes): change type hint

* style(listeners): change type hint

* style(routes): change type hint

* add some more types

* Change as_view typing

* Add some cleaner type annotations

Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2021-08-08 21:37:34 +03:00
Zhiwei Liang
3238aec55a Move reset to the front of copy method. 2021-08-08 04:29:41 -05:00
Zhiwei Liang
1022a46dbe Change Exception to SanicException 2021-08-07 16:41:32 -05:00
Zhiwei
9c8f2c619a
Fix if statement logic
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2021-08-07 16:03:58 -05:00
Zhiwei
54cee45d06
Merge branch 'main' into zhiwei/bp-copy 2021-08-07 15:29:37 -05:00
Adam Hopkins
8dbda247d6
Fix bug where ws exceptions not being logged (#2213)
* Fix bug where ws exceptions not being logged

* Fix t\est
2021-08-07 23:24:48 +03:00
Adam Hopkins
71a631237d
Add convenience methods to BP groups (#2209) 2021-08-07 23:06:11 +03:00
Zhiwei
9ae7158b11
Merge branch 'main' into zhiwei/bp-copy 2021-08-06 13:36:48 -05:00
Zhiwei Liang
d072ae3ae4 make pretty 2021-08-06 13:28:58 -05:00
Zhiwei Liang
45dd2a08ff Update test bp copy 2021-08-06 13:28:14 -05:00
Zhiwei Liang
0e90d9cdb6 Move reset method to above; try fix lint 2021-08-06 13:27:19 -05:00
Zhiwei
e22ff3828b
uncomment windows tests (#2214) 2021-08-06 11:52:38 +03:00
Zhiwei
84f9659998
Merge branch 'main' into zhiwei/bp-copy 2021-08-06 02:10:40 -05:00
Adam Hopkins
b1b12e004e
Signals Integration (#2160)
* Update some tests

* Resolve #2122 route decorator returning tuple

* Use rc sanic-routing version

* Update unit tests to <:str>

* Minimal working version with some signals implemented

* Add more http signals

* Update ASGI and change listeners to signals

* Allow for dynamic ODE signals

* Allow signals to be stacked

* Begin tests

* Prioritize match_info on keyword argument injection

* WIP on tests

* Compat with signals

* Work through some test coverage

* Passing tests

* Post linting

* Setup proper resets

* coverage reporting

* Fixes from vltr comments

* clear delayed tasks

* Fix bad test

* rm pycache
2021-08-05 22:55:42 +03:00
Can Sarigol
0ba57d4701
Fixed for handling exceptions of asgi app call. (#2211)
@cansarigol3megawatt Thanks for looking into this and getting the quick turnaround on this. I will 🍒 pick this into the 21.6 branch and get it out a little later tonight.
2021-08-02 19:12:12 +03:00
Néstor Pérez
54ca6a6178
Log remote address if available (#2207)
* Log remote address if available

* Add tests

* Fix testing version

Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2021-08-02 12:41:47 +03:00
Adam Hopkins
7dd4a78cf2
Update CHANGELOG 2021-07-28 12:12:30 +03:00
Adam Hopkins
52ff49512a
Merge branch 'current-release' of github.com:sanic-org/sanic 2021-07-28 12:10:47 +03:00
Adam Hopkins
5a48b94089
Bump version 21.6.1 v21.6.1 2021-07-28 11:41:26 +03:00
L. Kärkkäinen
ba1c73d947
Fix issues with after request handling in HTTP pipelining (#2201)
* Clean up after a request is complete, before the next pipelined request.

* Limit the size of request body consumed after handler has finished.

* Linter error.

* Add unit test re: bad headers

Co-authored-by: L. Kärkkäinen <tronic@users.noreply.github.com>
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2021-07-28 11:40:34 +03:00
L. Kärkkäinen
4732b6bdfa
Fix issues with after request handling in HTTP pipelining (#2201)
* Clean up after a request is complete, before the next pipelined request.

* Limit the size of request body consumed after handler has finished.

* Linter error.

* Add unit test re: bad headers

Co-authored-by: L. Kärkkäinen <tronic@users.noreply.github.com>
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2021-07-28 11:38:28 +03:00
Adam Hopkins
a6e78b70ab
Resolve regressions in exceptions (#2181) 2021-07-28 11:37:24 +03:00
L. Kärkkäinen
bb1174afc5
Fix the handling of the end of a chunked request. (#2188)
* Fix the handling of the end of a chunked request.

* Avoid hardcoding final chunk header size.

* Add some unit tests for pipeline body reading

* Decode bytes for json serialization

Co-authored-by: L. Kärkkäinen <tronic@users.noreply.github.com>
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2021-07-28 11:36:56 +03:00
Adam Hopkins
df8abe9cfd
Manually reset the buffer when streaming request body (#2183) 2021-07-28 11:34:57 +03:00
Robert Palmer
c3bca97ee1
Update sanic-routing to fix path issues plus lookahead / lookbehind support (#2178)
* Update sanic-routing to fix path issues plus lookahead / lookbehind support

* Update setup.py

Co-authored-by: Adam Hopkins <adam@amhopkins.com>
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
2021-07-28 11:33:53 +03:00
Zhiwei Liang
80029d636d Add reset method for init and reset bp instance; update copy method 2021-07-20 20:07:37 -05:00
Adam Hopkins
d4cd897522
Merge branch 'main' into zhiwei/bp-copy 2021-07-20 12:50:18 +03:00
Adam Hopkins
c3b6fa1bba
HTTP tests (#2194) 2021-07-19 16:52:33 +03:00
Adam Hopkins
94d496afe1
Change dumps to AnyStr (#2193) 2021-07-19 16:25:36 +03:00
gluhar2006
7b7a572f9b
raise exception for _static_request_handler unknown exception; add test with custom error (#2195)
Co-authored-by: n.feofanov <n.feofanov@visionlabs.ru>
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
2021-07-19 09:23:02 +03:00
Adam Hopkins
1b8cb742f9
Update README.rst 2021-07-18 23:22:19 +03:00
Adam Hopkins
3492d180a8
Update some CC config (#2199) 2021-07-18 12:32:35 +03:00
Zhiwei Liang
762c25e21a doc fix 2021-07-13 16:50:35 -07:00
Zhiwei Liang
176db5f8a4 Merge branch 'zhiwei/bp-copy' of https://github.com/ChihweiLHBird/sanic into zhiwei/bp-copy 2021-07-13 13:03:45 -07:00
Zhiwei Liang
0a8ee7be9d Fix typing 2 2021-07-13 13:03:05 -07:00
Zhiwei Liang
be1c09e7da Fix typing 2021-07-13 12:51:56 -07:00
Zhiwei
47ebddaee5
Merge branch 'main' into zhiwei/bp-copy 2021-07-13 12:51:48 -07:00
Zhiwei Liang
69c1a8e2ac Improve copy method in blueprint, adding possibiliy to keep original attribute values. 2021-07-13 12:48:28 -07:00
Ryu JuHeon
021da38373
style(app,blueprints): add some type hints (#2196)
* style(app,blueprints): add some type hints

* style(app): option is Any

* style(blueprints): url prefix default value is ``""``

* style(app): backward compatible

* style(app): backward compatible

* style(blueprints): defult is None

* style(app): apply code style (black)
2021-07-13 10:32:54 +03:00
Robert Palmer
ac784759d5
Update sanic-routing to fix path issues plus lookahead / lookbehind support (#2178)
* Update sanic-routing to fix path issues plus lookahead / lookbehind support

* Update setup.py

Co-authored-by: Adam Hopkins <adam@amhopkins.com>
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
2021-07-12 08:22:53 +03:00
Adam Hopkins
36eda2cd62
Resolve regressions in exceptions (#2181) 2021-07-12 00:35:27 +03:00
L. Kärkkäinen
08a4b3013f
Fix the handling of the end of a chunked request. (#2188)
* Fix the handling of the end of a chunked request.

* Avoid hardcoding final chunk header size.

* Add some unit tests for pipeline body reading

* Decode bytes for json serialization

Co-authored-by: L. Kärkkäinen <tronic@users.noreply.github.com>
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2021-07-11 13:44:40 +03:00
Zhiwei
46d9ebff4b
Merge branch 'main' into zhiwei/bp-copy 2021-07-08 11:42:30 -07:00
Zhiwei
1dd0332e8b
Remove Duplicated Dependencies and PEP 517 Support (#2173)
* Remove duplicated dependencies

* Specify setuptools as the tool for generating distribution (PEP 517)

* Add `isort` to `dev_require`

* manage all dependencies in setup.py

* Execute `make pretty`

* Set usedevelop to true (revert previous change)
2021-07-08 09:12:56 +03:00