2795 Commits

Author SHA1 Message Date
Adam Hopkins
976da69e79
Add a new exception signal for ALL exceptions raised anywhere in application () 2023-07-09 10:53:36 +03:00
Liam Coatman
11a0b15194
Handle case when headers argument of ResponseStream constructor is None ()
* Handle case when headers is None

* Add test for response stream with default headers

* Move test

---------

Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2023-07-09 10:34:40 +03:00
Adam Hopkins
c21999a248
Resolve headers on different renderers - Issue 2749 ()
* Resolve headers on different renderers - Issue 2749

* Make pretty
2023-07-09 09:57:22 +03:00
guacs
c17230ef94
Update request type on middleware types ()
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2023-07-09 09:35:24 +03:00
Adam Hopkins
049983cb70
Fix traversals for intended results () 2023-07-09 09:21:39 +03:00
Zhiwei
e374409567
Adding allow route overwrite option in blueprint ()
* Adding allow route overwrite option

* Add test case for route overwriting after bp copy

* Fix test

* Fix

* Add test case `test_bp_allow_override`

* Remove conflicted future routes when overwriting is allowed

* Improved test test_bp_copy_with_route_overwriting

* Fix type

* Fix type 2

* Add `test_bp_copy_without_route_overwriting` case

* make `allow_route_overwrite` flag to be internal

* Remove unwanted test case

---------

Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2023-07-07 14:56:42 +03:00
Adam Hopkins
4068a0d83d
Add name prefixing to BP groups () 2023-07-05 19:31:25 +03:00
Benjamin
70da5e9879
Fix Inner bug: TypeError: __init__() got an unexpected keyword argument 'escape_forward_slashes' () 2023-07-05 15:30:38 +03:00
Moshe Nahmias
f48506d620
fix - Improved error messaging on startup time application induced import error ()
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2023-07-05 14:38:15 +03:00
Mohammad Almoghrabi
f2cc83c1ba
fix examples for freeze_support() issue on windows ()
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2023-07-05 13:45:08 +03:00
Mohammad Almoghrabi
273825dab6
Sanic on pypy ()
Co-authored-by: L. Kärkkäinen <98187+Tronic@users.noreply.github.com>
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2023-07-05 12:14:47 +03:00
Zhiwei
9a7dafd531
Unpin setuptools version () 2023-07-05 11:06:43 +03:00
Thirumalaisamy K
50117d174c
Fix issue in getting current request through classmethod when served through a different ASGI server () 2023-06-14 22:03:43 +03:00
Néstor Pérez
af67801062
Fix JSONResponse default content type () 2023-04-09 22:23:21 +03:00
Adam Hopkins
6eaab2a7e5
Release 23.3 () v23.3.0 2023-03-26 22:54:28 +03:00
Adam Hopkins
d680af3709
v23.3 Deprecation Removal () 2023-03-26 15:24:08 +03:00
Adam Hopkins
a8c2d77c91
Sync state tolerance () 2023-03-26 08:39:59 +03:00
Adam Hopkins
6e1c787e5d
Simpler CLI targets ()
Co-authored-by: L. Kärkkäinen <98187+Tronic@users.noreply.github.com>
2023-03-21 20:50:25 +02:00
L. Kärkkäinen
932088e37e
Stricter charset handling and escaping of request URLs ()
Co-authored-by: L. Karkkainen <tronic@users.noreply.github.com>
2023-03-21 19:55:21 +02:00
Adam Hopkins
1a63b9bec0
Add convenience methods for cookie creation and deletion ()
* Add convenience methods for cookie creation and deletion

* Restore del

* Backwards compat, forward thinking

* Add delitem deprecation notice

* Add get full deprecation notice

* Add deprecation docstring

* Better deprecation docstring

* Add has_cookie

* Same defaults

* Better deprecation message

* Accessor annotations

* make pretty

* parse cookies

* Revert quote translator

* make pretty

* make pretty

* Add unit tests

* Make pretty

* Fix unit tests

* Directly include unquote

* Add some more unit tests

* Move modules into their own dir

* make pretty

* cleanup test imports

* Add test for cookie accessor

* Make test consistent

* Remove file

* Remove additional escaping

* Add header style getattr for hyphens

* Add test for cookie accessor with hyphens

* Add new translator

* Parametrize test_request_with_duplicate_cookie_key

* make pretty

* Add deprecation of direct cookie encoding

* Speedup Cookie creation

* Implement prefixes on delete_cookie

* typing changes

* Add passthru functions on response objects for setting cookies

* Add test for passthru

---------

Co-authored-by: L. Kärkkäinen <98187+Tronic@users.noreply.github.com>
2023-03-21 11:25:35 +02:00
Zhiwei
61aa16f6ac
Decode headers as UTF-8 also in ASGI ()
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2023-03-20 15:39:57 +02:00
Adam Hopkins
71cd53b64e
Standardize init of exceptions () 2023-03-20 14:50:50 +02:00
Adam Hopkins
89188f5fc6
Add CertLoader as application option () 2023-03-20 14:05:21 +02:00
Adam Hopkins
a245ab3773
Change logging format to %s () 2023-03-20 13:25:06 +02:00
Adam Hopkins
ac1f56118a
Skip middleware on RequestCancelled () 2023-03-20 13:00:34 +02:00
Adam Hopkins
53820bc241
Allow password to be passed to TLS context () 2023-03-20 12:34:36 +02:00
stricaud
009954003c
Fix comparison from wrong formats with datetime objects ()
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2023-03-20 12:12:09 +02:00
Adam Hopkins
8f265b8169
Add convenience for dynamic changes to routing () 2023-03-19 15:40:58 +02:00
Adam Hopkins
5ee36fd933
Separate ASGI request and lifespan callables () 2023-03-17 09:05:33 +02:00
Matt Bendiksen
08a81c81be
scheme arg to create the redirect should be 'https' () 2023-03-16 12:13:17 +02:00
Adam Hopkins
5a0ed75171
Consume body on DELETE by default () 2023-03-15 18:42:45 +02:00
Adam Hopkins
d62a92fac9
API to define a number of workers () 2023-03-15 16:02:17 +02:00
Adam Hopkins
88c918e72f
Update rfc.yml 2023-03-09 10:10:22 +02:00
Adam Hopkins
c8aab8fb3d
Update rfc.yml 2023-03-09 10:09:30 +02:00
Adam Hopkins
ecacfd396b
Rename rfc to rfc.yml 2023-03-09 10:06:42 +02:00
Adam Hopkins
3c361e9852
Create rfc 2023-03-09 10:05:06 +02:00
L. Kärkkäinen
a5d7d03413
Nicer traceback formatting ()
Co-authored-by: L. Kärkkäinen <98187+Tronic@users.noreply.github.com>
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
Co-authored-by: L. Karkkainen <tronic@users.noreply.github.com>
Co-authored-by: SML <smlbiobot@gmail.com>
2023-03-06 21:24:12 +02:00
L. Kärkkäinen
259e458847
Simplified parse_content_header escaping () 2023-03-06 06:39:16 +02:00
Adam Hopkins
cb49c2b26d
Add header accessors () 2023-02-28 00:26:53 +02:00
L. Kärkkäinen
dfc0704831
Error page rendering format selection ()
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
Co-authored-by: L. Karkkainen <tronic@users.noreply.github.com>
2023-02-26 08:25:10 +02:00
Adam Hopkins
d238995f1b
Refresh Request.accept functionality () 2023-02-21 08:22:51 +02:00
Mohammad Almoghrabi
6f5303e080
check the status of socket before shutting down ()
* check the status of socket before shutting down

* remove socket status checking & ignore OSError exception
2023-02-14 22:59:41 +02:00
Ryu Juheon
5e7f6998bd
fix(websocket): ASGI websocket must pass thru bytes as is () 2023-02-05 16:41:54 +02:00
L. Kärkkäinen
c7a71cd00c
Use FALLBACK_ERROR_FORMAT for handlers that return empty() ()
Co-authored-by: L. Karkkainen <tronic@users.noreply.github.com>
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
2023-02-05 15:29:01 +02:00
Adam Hopkins
9cb9e88678
Establish basic file browser and index fallback ()
Co-authored-by: L. Kärkkäinen <98187+Tronic@users.noreply.github.com>
Co-authored-by: L. Karkkainen <tronic@users.noreply.github.com>
2023-02-05 15:09:04 +02:00
Rodolfo Olivieri
30c53b6857
Remove deprecated property in blueprint ()
Fixes https://github.com/sanic-org/sanic/issues/2442
2023-01-30 09:26:55 +02:00
Adam Hopkins
4ad8168bb0
Version 22.12 release notes () v22.12.0 2022-12-27 16:50:36 +02:00
Adam Hopkins
28f5b3c301
Add better inspector arg parsing () 2022-12-26 12:27:40 +02:00
Adam Hopkins
c573019e7f
ASGI websocket recv text or bytes () 2022-12-25 13:52:07 +02:00
Adam Hopkins
029f564032
Pass unquote thru add_route () 2022-12-21 10:45:23 +02:00