Mykhailo Yusko
9a39aff803
Replaced str.format() method in core functionality ( #1819 )
...
* Replaced str.format() method in core functionality
* Fixed linter checks
2020-04-06 12:45:25 -07:00
L. Kärkkäinen
ba9b432993
No tracebacks on normal errors and prettier error pages ( #1768 )
...
* Default error handler now only logs traceback on 500 errors and all responses are HTML formatted.
* Tests passing.
* Ability to flag any exception object with self.quiet = True following @ashleysommer suggestion.
* Refactor HTML formatting into errorpages.py. String escapes for debug tracebacks.
* Remove extra includes
* Auto-set quiet flag also when decorator is used.
* Cleanup, make error pages (probably) HTML5-compliant and similar for debug and non-debug modes.
* Fix lookup of non-existant status codes
* No logging of 503 errors after all.
* lint
2020-01-20 08:58:14 -06:00
Yun Xu
f21db60859
fix: handle expect header
2019-06-03 22:08:24 -07:00
Harsha Narayana
e6fba01682
add documentation for cookies, exception, blueprint and handlers
...
Signed-off-by: Harsha Narayana <harsha2k4@gmail.com>
2018-12-28 10:22:28 +05:30
Yun Xu
8ef7bf8e7b
integrate with isort
2018-10-17 21:20:16 -07:00
Yun Xu
aa9bf04dfe
run black against sanic module
2018-10-13 17:55:33 -07:00
Stephen Sadowski
6778f4d9e0
Merge pull request #1342 from hramezani/load_config_file_syntax_error
...
Handle syntax error in load config file.
2018-10-11 08:56:48 -05:00
Hasan Ramezani
f4c55bbc07
Handle config error in load config file.
2018-10-08 19:17:06 +02:00
Igor Hatarist
f8a6af1e28
Rename the http
module to helpers
to prevent conflicts with the built-in Python http library ( fixes #1323 )
2018-09-25 20:46:40 +03:00
Arnulfo Solís
9092ee9f0e
HTTP Entity Headers ( #1127 )
...
* introduced basic entity and hopbyhop header identification
* removed entity headers
* coding style fixes
* remove unneeded header check
* moved from bytes to unicode in headers
* changed list to tuple in empty response statuses
2018-06-26 22:25:25 -07:00
Raphael Deem
9c02cdbad9
double quotes in unauthorized exception per rfc7230
2017-12-21 18:05:05 -08:00
Raphael Deem
2c3f50e34a
fix stream handling
2017-12-13 23:06:18 -08:00
Raphael Deem
2b0258c13a
fix issues with method not allowed response
2017-12-11 20:12:26 -08:00
davidtgq
5bcbc5a337
Replaced COMMON_STATUS_CODES with a simple 200 check for more fast ( #982 )
...
* Replaced COMMON_STATUS_CODES with a simple 200 check for more fast
* Added IPware algorithm
* Remove HTTP prefix from Django-style headers
Remove right_most_proxy because it's outside spec
* Remove obvious docstrings
* Revert "Replaced COMMON_STATUS_CODES with a simple 200 check for more fast"
This reverts commit 15b6980
* Revert "Added IPware algorithm"
This reverts commit bdf66cb
WTF HOW DO I GIT
* Revert "Revert "Replaced COMMON_STATUS_CODES with a simple 200 check for more fast""
This reverts commit d8df095
* Revert "Added IPware algorithm"
This reverts commit bdf66cb
* Delete ip.py
2017-10-19 16:43:07 -07:00
Ashley Sommer
2979e03148
WIP - Split RequestTimeout, ResponseTimout, and KeepAliveTimeout into different timeouts, with different callbacks.
2017-09-11 17:17:33 +10:00
Darren
6038813d03
fix #914 , change arguments of Unauthorized.__init__
2017-08-24 22:59:25 +08:00
François KUBLER
69a8bb5e1f
Fixed a trailing white space in the docstring.
2017-07-28 22:29:45 +02:00
François KUBLER
b65eb69d9f
Simplified the Unauthorized exception __init__ signature.
...
(again).
Use of **kwargs makes it more straight forward and easier to use.
2017-07-27 23:00:27 +02:00
Raphael Deem
173c62acb6
Merge branch 'master' into unauthorized-exception
2017-07-21 01:54:45 -07:00
Raphael Deem
e0f06753c6
Merge pull request #831 from yunstanford/auto-doc
...
Improve Documentation.
2017-07-12 20:20:51 -07:00
Yun Xu
e48bd08095
make flake8 happy
2017-07-02 10:05:33 -07:00
Yun Xu
5d00717f39
improve doc and remove warnings
2017-07-02 10:02:04 -07:00
François KUBLER
e427e38da8
Simplified the Unauthorized.__init__
signature.
...
It doesn't really make sense to have a `realm` parameter in the method signature.
Instead, one can simply set the realm in the `challenge` dict if necessary.
Also fixed the tests accordingly (and added a new one for "Bearer" auth-scheme).
2017-06-29 12:34:52 +02:00
François
76e62779ba
Merge branch 'master' into forbidden-exception
2017-06-28 17:25:40 +02:00
François KUBLER
2848d7c80e
Added a Forbidden exception
...
Also added a small test.
2017-06-23 16:44:57 +02:00
François KUBLER
9fcdacb624
Modified the name of an argument.
2017-06-23 16:29:04 +02:00
François KUBLER
cf1713b085
Added a Unauthorized exception.
...
Also added a few tests related to this new exception.
2017-06-23 16:12:15 +02:00
Raphael Deem
9efa7c116d
remove redundant code; decode response
2017-05-20 23:27:00 -07:00
Raphael Deem
1a60201f68
flake8 spacing
2017-05-20 10:44:09 -07:00
Raphael Deem
f3186abf09
SANIC_EXCEPTIONS -> _sanic_exceptions
2017-05-20 10:29:00 -07:00
Raphael Deem
588b4712bf
add exception decorator
2017-05-20 01:24:34 -07:00
Raphael Deem
d3b6208057
add abort function
2017-05-19 18:52:19 -07:00
Raphael Deem
58a9c92d75
fix 739
2017-05-19 13:35:04 -07:00
Alec Buckenheimer
69511c2783
added exception chain rendering in debug #675
2017-05-01 12:56:33 -04:00
Suby Raman
b40f30f2e5
fix tests
2017-03-03 11:49:35 -05:00
Eli Uriegas
579afe012b
Fixes errors related to #378
2017-02-08 19:59:34 -06:00
Eli Uriegas
eb059183f7
Merge branch 'master' into master
2017-02-08 19:37:32 -06:00
Eli Uriegas
a5a7490bca
Merge pull request #379 from youknowone/exception
...
Let exception handler handle inherited exceptions
2017-02-08 19:20:42 -06:00
Jeong YunWon
413c92c631
Let exception handler handle inherited exceptions
...
Original sanic exception handler only could handle exact matching
exceptions. New `lookup` method will provide ability to looking up
their ancestors without additional cost of performance.
2017-02-07 21:08:31 +09:00
Suby Raman
7c09ec29f7
rebase
2017-02-02 12:21:14 -05:00
Kyle Blöm
d193a1eb70
Added the tests, code formatting changes, and the Range Request feature.
2017-01-30 17:04:51 -08:00
Jordan Pittier
fa36dcbe09
Use `isinstance(
instead of
issubclass(type(
`
...
When we already have an `instance` it's less typing and faster to
use `isinstance`.
2017-01-27 11:11:29 +01:00
Raphael Deem
28f7abd1f8
set error handler debug from run debug arg
2017-01-24 17:24:06 -08:00
Cadel Watson
7c4ffa8866
Merge branch 'master' into sphinx-docs
2017-01-20 09:30:42 +11:00
zkanda
cc43ee3b3d
Always log of there's an exception occured.
2017-01-19 16:03:12 +08:00
Cadel Watson
9d4b104d2d
Merge branch 'master' into sphinx-docs
2017-01-19 08:48:54 +11:00
Suby Raman
8c5e214131
html and tests pass
2017-01-12 19:54:34 -05:00
Eli Uriegas
7a8fd6b0df
Add more verbose error handling
...
* Adds logging to error messages in debug mode as pointed out in PR #249 ,
while also improving the debug message.
2016-12-30 13:48:17 -06:00
Cadel Watson
52c59e7133
Fix all docstring errors.
...
When generating documentation with sphinx-apidoc, there are currently
many docstring errors, mostly minor. This commit fixes all errors.
2016-12-25 20:43:45 +11:00
38elements
662e0c9965
Change Payload Too Large process
...
When Payload Too Large occurs, it uses error handler.
2016-12-04 10:50:32 +09:00