Yun Xu
d5d1d3b45a
add trigger before_start events in create_server
2017-08-08 21:58:10 -07:00
Miguel Grinberg
375ed23216
Weboscket subprotocol negotiation
...
Fixes #874
2017-08-08 11:40:44 -07:00
MichaelYusko
7216bf7835
merge master into local branch
2017-08-03 12:11:47 +03:00
Eli Uriegas
f80a6ae228
Increment to 0.6.0
2017-08-02 19:11:53 -07:00
Eli Uriegas
2228104bff
Merge pull request #862 from zyguan/revert-599fbce
...
revert 599fbce
2017-07-31 13:51:04 -07:00
Raphael Deem
402c3752c4
Merge pull request #871 from Frzk/unauthorized-exception
...
Simplified the Unauthorized exception __init__ signature.
2017-07-31 12:23:12 -07: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
MichaelYusko
429f7377cb
Did the small changes for better readable
2017-07-26 19:32:23 +03:00
zyguan
918e2ba8d0
Revert "fix #752 "
...
This reverts commit 599fbcee6e
.
2017-07-24 11:53:11 +08:00
zyguan
f50dc83829
handle keep-alive timeout gracefully
2017-07-24 01:37:36 +08:00
Raphael Deem
173c62acb6
Merge branch 'master' into unauthorized-exception
2017-07-21 01:54:45 -07:00
Mohamed Akram
32be1a6496
Fix FreeBSD syslog path
2017-07-20 03:02:40 +04:00
Yun Xu
198bf55b7b
flake8 fix
2017-07-14 17:23:18 -07:00
Yun Xu
75378d3567
add remote_addr property for proxy fix
2017-07-14 09:29:16 -07:00
zenix
426e00b6f4
dont let dictConfig influence already exists configs
2017-07-13 15:09:04 +09:00
Raphael Deem
4265ad5f23
add versioning
2017-07-12 22:19:42 -07:00
Raphael Deem
8aafd72ef0
Merge branch 'auto-doc' of https://github.com/yunstanford/sanic
2017-07-12 20:19:30 -07:00
Jeong YunWon
47abf83960
Protocol configurable gunicorn worker
2017-07-12 22:30:13 +09:00
Jeong YunWon
be0f3731b4
ensure loop.close() and sys.exit() in gunicorn worker
2017-07-12 22:26:58 +09:00
Yun Xu
235687d983
should call lower just once
2017-07-10 12:37:21 -07:00
Yun Xu
3d75e6ed95
case-insensitive check for header fields
2017-07-10 12:29:47 -07:00
Raphael Deem
f0a956467c
Merge pull request #815 from yunstanford/master
...
add graceful timeout when shutdown
2017-07-08 11:31:37 -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
Yun Xu
3fff685c44
add auto-doc support
2017-07-01 23:46:34 -07:00
Raphael Deem
1e75265eed
Merge pull request #756 from qwesda/master
...
fixes #755 fragmented headers
2017-06-30 18:24:51 -07:00
Raphael Deem
421f78f3e6
Merge pull request #814 from Frzk/forbidden-exception
...
Added a Forbidden exception
2017-06-30 18:11:23 -07:00
Raphael Deem
00d4533022
Merge pull request #821 from Frzk/bearer-support
...
Inverted the order of prefixes in Request.token property.
2017-06-29 09:43:34 -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 KUBLER
1f24abc3d2
Fixed support for "Bearer" and "Token" auth-schemes.
...
Removed the test for "Authentication: Bearer Token <TOKEN>" which was not supposed to exist (see https://github.com/channelcat/sanic/pull/821 )
Also added a call to `split` when retrieving the token value to handle cases where there are leading or trailing spaces.
2017-06-29 10:23:49 +02:00
François
76e62779ba
Merge branch 'master' into forbidden-exception
2017-06-28 17:25:40 +02:00
Daniel Schwarz
b141fec573
Merge remote-tracking branch 'upstream/master'
...
# Conflicts:
# sanic/server.py
2017-06-27 13:32:49 +02:00
François KUBLER
d2e14abfd5
Inverted the order of prefixes in Request.token property.
...
As suggested by @allan-simon
See: https://github.com/channelcat/sanic/pull/811#pullrequestreview-46144327
2017-06-27 12:57:47 +02:00
Raphael Deem
d4abca0480
Merge pull request #818 from youknowone/debug
...
Introduce debug mode for HTTP protocol
2017-06-26 22:02:37 -07:00
Raphael Deem
395d85a12f
use try/except
2017-06-26 21:35:01 -07:00
Raphael Deem
4379a4b067
float logic
2017-06-26 20:59:59 -07:00
Raphael Deem
ad8e1cbf62
convert environment vars to int if digits
2017-06-26 20:49:41 -07:00
Jeong YunWon
dc5a70b0de
Introduce debug mode for HTTP protocol
2017-06-26 21:13:13 +09:00
Yun Xu
b5d1f52ea4
make flake8 happy
2017-06-25 10:22:40 -07:00
Yun Xu
d812affef0
add graceful_shutdown_timeout to gunicorn worker
2017-06-25 00:51:14 -07:00
Yun Xu
5c19eb34bf
add graceful_shutdown_timeout
2017-06-24 19:00:33 -07:00
Eli Uriegas
dbcbf12456
Merge pull request #811 from Frzk/bearer-support
...
Added support for 'Authorization: Bearer <TOKEN>' header...
2017-06-23 10:32:21 -07:00
Eli Uriegas
c04b44057c
Merge pull request #813 from Frzk/unauthorized-exception
...
Added an Unauthorized exception
2017-06-23 10:30:51 -07: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
7
f049a4ca67
Recycling gunicorn worker ( #800 )
...
* add recycling feature to gunicorn worker
* add unit tests
* add more unit tests, and remove redundant trigger_events call
* fixed up unit tests
* make flake8 happy
* address feedbacks
* make flake8 happy
* add doc
2017-06-22 13:26:50 -07:00
François KUBLER
55f860da2f
Added support for 'Authorization: Bearer <TOKEN>' header in Request.token
property.
...
Also added a test case for that kind of header.
2017-06-22 18:11:23 +02:00
Nikola Kolevski
d865c5e2b6
Conform to pep8
2017-06-20 13:22:28 +02:00
Nikola Kolevski
9fac37588c
Allow textual responses when using test_client and aiohttp 2
2017-06-20 13:15:30 +02:00
Eli Uriegas
b37e6187d4
Merge pull request #802 from yunstanford/add-match-info
...
Add match_info property to request class
2017-06-18 10:15:46 -07:00
Yun Xu
20138ee85f
add match_info to request
2017-06-17 09:47:58 -07:00
Eran Kampf
77cf0b678a
Fix has_log value
2017-06-15 11:21:08 -07:00
Eran Kampf
2dfb061063
Prevent run
from overriding logging config set in constructor
...
When creating the `Sanic` instance I provide it with a customized `log_config`.
Calling `run` overrides these settings unless I provide it *again* with the same `log_config`.
This is confusing and error prone. `run` shouldnt override configurations set in the `Sanic` constructor...
2017-06-15 10:39:00 -07:00
Raphael Deem
599fbcee6e
fix #752
2017-06-11 23:20:04 -07:00
Eli Uriegas
38997c1b47
Merge pull request #786 from yunstanford/handle_stream_404
...
Handle stream 404
2017-06-10 10:03:54 -07:00
Yun Xu
cf30ed745c
also should handle InvalidUsage exception
2017-06-10 09:42:48 -07:00
Yun Xu
4942af27dc
handle NotFound
2017-06-09 08:33:34 -07:00
Jeong YunWon
29b4a2a08c
Gunicorn worker hints app weather it is being terminated
...
For now, `Sanic.is_running` is set when the worker is started but not
unset when it is about to stopped. Setting the flag for quit signal
will not affect working requests, but the `Sanic.is_running` flag still
can be used to support graceful termination.
2017-06-09 14:51:15 +09:00
Yun Xu
aac99c45c0
add content_type property in request
2017-06-07 20:46:48 -07:00
Miroslav Batchkarov
3f22b644b6
wrap call to json in try-except to make tests pass
2017-06-07 09:57:07 +01:00
Miroslav Batchkarov
199fa50a9d
also store json result in local request
2017-06-05 16:24:23 +01:00
Tue Topholm
3d97fd8d2a
Removed whitespace
2017-06-01 23:09:37 +02:00
Tue Topholm
c102e76146
Fixed line width
2017-06-01 23:01:27 +02:00
Tue Topholm
f47e571d92
Added content_type to be set for son response
2017-06-01 22:53:56 +02:00
Daniel Schwarz
30c2c89c6b
fix partial url parsing
2017-05-30 16:13:49 +02:00
Daniel Schwarz
aaef2fbd01
fix flake8 errors
2017-05-28 18:46:07 +02:00
Daniel Schwarz
0e5c7a62cb
remove debug messages
2017-05-27 22:36:08 +02:00
Daniel Schwarz
1b33e05f74
fix debug log messages
2017-05-27 16:32:39 +02:00
Daniel Schwarz
53a04309ff
add header_fragment handeling
2017-05-27 16:28:57 +02:00
Daniel Schwarz
dc411651b6
add check for header and value
2017-05-27 15:36:57 +02:00
Daniel Schwarz
514540b90b
add debug for header values
2017-05-27 15:32:37 +02:00
messense
0024edbbb9
Add websocket max_size and max_queue configuration
2017-05-26 11:15:28 +08:00
Eli Uriegas
48de321869
Merge pull request #697 from 38elements/stream
...
Add Request.stream
2017-05-24 16:22:52 -07:00
Raphael Deem
c6d68009d2
Merge pull request #745 from messense/feature/gunicorn-worker-test-case
...
Add a simple integration test for Gunicorn worker
2017-05-23 20:53:01 -07:00
Raphael Deem
2cab267405
Merge pull request #734 from ashleysommer/static_large_file_stream
...
Add option to static helper to use streaming for large files.
2017-05-23 20:52:12 -07:00
messense
6bdc0d2e5e
Fix Gunicorn worker
2017-05-23 11:28:12 +08:00
Raphael Deem
b447807b36
Merge pull request #742 from r0fls/700
...
changes required for unix socket support
2017-05-22 19:29:32 -07:00
Raphael Deem
52b0254ec6
unix socket support; fixes #700
2017-05-21 03:15:06 -07:00
Raphael Deem
49631542ce
Merge pull request #732 from jrocketfingers/feature/explicit-register-middleware
...
Extract register_middleware into a method.
2017-05-21 03:06:12 -07:00
Raphael Deem
4b80ffb9eb
Merge pull request #740 from r0fls/739
...
add abort function
2017-05-21 02:20:02 -07: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
Ashley Sommer
ef80953b1b
Fix flake8 line length error.
2017-05-20 09:56:05 +10:00
ashleysommer
72db1188c7
Add an option to the static() helper to switch on streaming for large files.
...
By default uses a 1M threshold.
ie. if the static file to serve is >= 1M it will stream the file.
This threshold value is configurable by passing an int instead of a bool to `stream_large_files` parameter of `static()`.
2017-05-20 09:56:05 +10:00
Raphael Deem
58a9c92d75
fix 739
2017-05-19 13:35:04 -07:00
Ashley Sommer
ff2ae11ac8
Remove exception print(e) statement.
2017-05-19 13:00:01 +10:00
Johnny Rocketfingers
3f841f3b21
Switch to non-hardcoded register_middleware.
2017-05-18 22:08:44 +02:00
ashleysommer
e155fe403d
Add file_stream response handler
...
For streaming large static files
Like `file()` but breaks the file into chunks and sends it with a `StreamingHTTPResponse`
Chunk size is configurable, but defaults to 4k, this seemed to be the sweet spot in my testing.
Also supports ContentRange same as `file()` does.
2017-05-18 18:04:28 +10:00
Johnny Rocketfingers
bf5438d573
Extract register_middleware into a method.
2017-05-18 06:36:11 +02:00
Raphael Deem
0e4aaf8856
Merge pull request #731 from jrocketfingers/fix/token-missing-auth-headers
...
Check that the Authorization headers are actually provided.
2017-05-17 13:10:12 -07:00
Raphael Deem
5c44ce1637
Merge pull request #719 from messense/feature/worker-uvloop
...
Gunicorn worker should not require uvloop
2017-05-17 12:47:19 -07:00
Raphael Deem
974fe25a11
Merge pull request #722 from messense/feature/ci-without-ext
...
Add py3*-no-ext test env
2017-05-17 12:47:05 -07:00
Johnny
5d309af86f
Check that the headers are actually provided.
2017-05-17 11:08:50 +02:00
messense
2f84cdd708
Fix websocket handler bug on Python3.5 with no uvloop
2017-05-17 12:12:25 +08:00
messense
7cc02e84ed
Fix json loads bug on Python 3.5
2017-05-17 12:12:25 +08:00
messense
05d0ddc281
Gunicorn worker should not require uvloop
2017-05-15 00:01:51 +08:00
Johnny Rocketfingers
b1890f50b6
Conform to pep8
2017-05-14 10:15:11 +02:00
Johnny Rocketfingers
b44c707e94
Prevent incorrect tuple size on get_extra_info errors
...
According to https://docs.python.org/3/library/asyncio-protocol.html#asyncio.BaseTransport.get_extra_info ,
get_extra_info fails by returning None. This is an attempt in
normalization of the response in cases of AF_INET, AF_INET6 and
erroneous return values.
2017-05-14 09:56:56 +02:00
Johnny
4c7675939a
Fix "TypeError: not all arguments converted during string formatting"
...
socket.getpeername() returns AF_INET6 address family four-tuple, with
flowid and scopeid.
In server's write_response, an exception is raised when an IPv6 client
connects due to four-tuple elements having two unused elements (flowid
and scopeid).
This makes sure that only the first two (host and port) are used in log
string formatting.
2017-05-13 17:35:04 +02:00
Eli Uriegas
fa1b7de52a
Merge pull request #706 from messense/feature/remove-log-file
...
Remove timedRotatingFile log config
2017-05-12 10:56:19 -07:00
Jeremy Zimmerman
f39512aa63
double if statement ( #707 )
...
* Migrated `%` string formating
* double if statement
combined double 'if' to a single 'if' with 'and'
* Revert "Fix "Prefer `format()` over string interpolation operator" issue"
2017-05-11 11:49:32 -07:00
messense
c3683662c2
Remove timedRotatingFile log config
2017-05-11 11:18:59 +08:00
38elements
6a14e49479
Replace stream decorator to stream parameter
2017-05-09 22:31:15 +09:00
Eli Uriegas
ac5e1a6ebd
Fix import
2017-05-08 20:47:20 -07:00
Eli Uriegas
bfcd499cc2
Remove default_filter module, put into logging
2017-05-08 20:41:34 -07:00
Eli Uriegas
3e88ec18e2
Actually add file >.>
2017-05-08 20:37:44 -07:00
Eli Uriegas
1fb640c313
Fix camel case module
2017-05-08 20:36:57 -07:00
Eli Uriegas
307d866bb6
Increment to 0.5.4
2017-05-08 17:44:23 -07:00
Eli Uriegas
768be433d6
Increment to 0.5.3
2017-05-08 17:42:26 -07:00
38elements
4d4f38fb35
is_request_stream for CompositionView and HTTPMethodView
2017-05-09 01:04:03 +09:00
38elements
0b53c413a7
Add stream decorator for HTTPMethodView
2017-05-07 21:33:15 +09:00
38elements
931397c7e1
Add stream for CompositionView
2017-05-07 18:38:48 +09:00
38elements
ef2cc7ebf5
Add Request.stream
2017-05-07 18:38:48 +09:00
38elements
25037006bf
Remove utils.py
2017-05-04 15:52:18 +09:00
38elements
e12c10b087
Remove loop argument in run() and create_server()
2017-05-03 17:52:19 +09:00
38elements
0a2c95cc10
Remove before_start, before_stop, after_start and after_stop
2017-05-02 23:07:09 +09:00
Eli Uriegas
c35721abbd
Merge pull request #670 from ticosax/set-exit-code-on-error
...
In case of error when starting sanic
2017-05-01 15:16:02 -07:00
Alec Buckenheimer
69511c2783
added exception chain rendering in debug #675
2017-05-01 12:56:33 -04:00
banteg
7754bb995b
expose matched request uri template
2017-04-29 02:39:56 +07:00
Nicolas Delaby
d1fefce61c
fixup! In case of error when starting sanic
2017-04-28 20:06:44 +02:00
Nicolas Delaby
c3abdab9c4
The main process that spawn sub processes doesn't run any loop.
...
let's not try to stop one
2017-04-28 19:57:49 +02:00
Nicolas Delaby
8b13e103fd
In case of error when starting sanic
...
Don't exit with code 0
2017-04-28 19:08:51 +02:00
Eli Uriegas
436d37c079
Add the killing of children
...
Kills children processes when parent process receives a signal to
shutdown.
Solves for #594
2017-04-27 17:47:08 -07:00
Eli Uriegas
ed0081fcf7
Merge pull request #625 from zenixls2/master
...
based on issue #608 , create access log
2017-04-27 14:31:53 -07:00
Eli Uriegas
140062f8a3
Merge pull request #662 from rsrdesarrollo/master
...
invariant: body after request is processed must be binary
2017-04-27 14:31:28 -07:00
Philip Xu
9152a1a266
Improved on wording
2017-04-27 03:16:38 -04:00
Philip Xu
ade89ab795
Fix #665 - ImportError not preserved in __main__.py
2017-04-26 22:57:19 -04:00
Raúl Sampedro
85acddddba
invariant: body after request is processed must be binary
2017-04-25 12:00:27 +02:00
zenix
c9d747d97f
fix merge error
2017-04-25 11:46:13 +09:00
zenix
0bba267808
Merge branch 'master' of https://github.com/channelcat/sanic
2017-04-25 11:07:40 +09:00
Eli Uriegas
5fd62098bd
Increment to 0.5.2
2017-04-24 11:37:04 -07:00
Raphael Deem
74cc7be922
Merge branch 'master' into master
2017-04-24 00:47:01 -07:00
Raphael Deem
b3814ca89a
Merge pull request #646 from r0fls/637
...
allow disabling keep alive
2017-04-24 00:43:16 -07:00
Raphael Deem
9caa4fec4a
Merge pull request #656 from r0fls/token-rework
...
update token attribute
2017-04-21 22:44:42 -07:00
Raphael Deem
a0cba1aee1
accept token directly in auth header
2017-04-21 22:36:45 -07:00
Eli Uriegas
a7d17fae44
Fix duplicate signal settings for gunicorn worker
2017-04-21 17:06:52 -05:00
38elements
bc035fca78
Remove unnecessary variables
2017-04-20 18:27:28 +09:00
38elements
df914a92e4
Fix this.signal.stopped
is True
#639
2017-04-19 11:19:01 +09:00
Raphael Deem
81b6d988ec
NO_KEEP_ALIVE -> KEEP_ALIVE
2017-04-16 22:43:49 -07:00
Raphael Deem
5ddb0488f2
allow disabling keep alive
2017-04-16 22:03:20 -07:00
Raphael Deem
3e87314adf
use absolute path in static root
2017-04-16 21:58:10 -07:00
Raphael Deem
f6d4a06661
Merge pull request #643 from aryeh/allow_unknown_status_codes
...
Allow unknown status codes
2017-04-16 18:42:59 -07:00
Raphael Deem
ff17fc95e6
Merge pull request #632 from messense/feature/path-route
...
Add path type for router
2017-04-16 18:39:10 -07:00
aryeh
ff0632001c
prevent crash for unknown response codes
...
set text for unknown status code, otherwise when None is used exception occurs.
2017-04-16 10:07:29 -04:00
lazydog
ae09dec05e
fixed UnboundLocalError
2017-04-14 03:38:55 +08:00
lazydog
afd51e0823
fix directory traversal flaw
2017-04-14 02:55:39 +08:00
zenix
0bbf826b21
fix typo
2017-04-13 16:52:40 +09:00
zenix
02d1900e2f
try to fix container error
2017-04-13 16:49:36 +09:00
zenix
73da11b04c
switch to use streaming for access log and error log
2017-04-13 16:26:13 +09:00
zenix
4af07e3731
change naming of default log config
2017-04-13 13:49:45 +09:00
zenix
7f60f85cd4
Merge branch 'master' of https://github.com/channelcat/sanic
2017-04-13 13:35:37 +09:00
messense
4c66cb1854
Fix static files router
2017-04-13 12:11:38 +08:00
messense
35b92e1511
Add path type for router
2017-04-13 11:34:35 +08:00
Raphael Deem
e5d3fe52c5
Merge pull request #630 from 38elements/keep_alive
...
Refactor keep_alive
2017-04-12 19:46:33 -07:00
zenix
c5f137c715
fix original code logic
2017-04-12 18:52:01 +09:00
zenix
66923bc0e3
remove unused param
2017-04-12 18:48:16 +09:00
zenix
36d4d85849
change to use default python config code
2017-04-12 18:44:47 +09:00
zenix
5f0e05f3bf
fix flake8
2017-04-12 18:08:06 +09:00
adam.serafini
235e5511eb
Bump version
2017-04-12 11:02:13 +02:00
zenix
6fb60ae0b1
Merge branch 'master' of https://github.com/channelcat/sanic
2017-04-12 18:01:12 +09:00
38elements
7fe418d1b7
Refactor keep_alive
2017-04-12 17:55:22 +09:00
zenix
f872ceb0d9
fix bug in access logging when error happens
2017-04-12 17:39:17 +09:00
Eli Uriegas
015c87b5e1
Add traceback for better debugging
2017-04-11 16:02:57 -05:00
Eli Uriegas
084f0d27a3
Increment to 0.5.0
2017-04-11 15:19:00 -05:00
Eli Uriegas
522a0beec0
Merge pull request #622 from aryeh/provide_request_object
...
Allow a custom Request class to be passed in to Sanic
2017-04-11 15:13:05 -05:00
zenix
bf46bcf376
Merge branch 'logging'
2017-04-11 19:03:35 +09:00
zenix
f330c3f8c5
add logging based on issue #608 , add default config
2017-04-11 18:59:07 +09:00
ivan
09885534c6
fixed #615
2017-04-10 18:31:28 +08:00
aryeh
b9dfec38c2
Break long line (> 80 chars) into 2 lines
2017-04-09 13:38:36 -04:00
aryeh
2ef8120073
Allow a custom Request class to be passed in to Sonic
...
Allowing a custom Request class to be defined would enable either a different Request class or a subclass of Request to be used, providing more flexibility.
2017-04-09 13:29:21 -04:00
Raphael Deem
8cf7dce33f
fix python -m method of running
2017-04-08 13:31:17 -07:00
Raphael Deem
7e3496f8aa
Merge pull request #614 from dkruchinin/middleware
...
Response middleware should be called even if server replies with an error
2017-04-06 11:49:44 -07:00
Raphael Deem
1854ad133c
use socket.set_inheritable instead of os version
2017-04-04 13:13:52 -07:00
Dan Kruchinin
f0a59fccf8
flake8-related fixes
2017-04-04 17:19:45 +01:00
Dan Kruchinin
46dbaf95a6
Response middleware should be called even if server replies with error
2017-04-04 15:55:43 +01:00
Jeong YunWon
429e90183b
Add #379 again and make related test rework
...
Original PR: https://github.com/channelcat/sanic/pull/379
2017-04-03 18:56:39 +09:00
monobot
e148b50d6a
Merge remote-tracking branch 'upstream/master'
2017-04-02 00:02:49 +01:00
Raphael Deem
06d46d56cd
Merge pull request #602 from jkbbwr/fix/env-install
...
Flake8 cleanup. Setup environmental variables.
2017-03-31 10:42:21 -07:00
Jakob Bowyer
daedda8547
Checked out original tests
2017-03-31 08:51:12 +01:00
monobot
6c003f71f4
Merge remote-tracking branch 'upstream/master'
2017-03-29 23:54:11 +01:00
monobot
5b704478d9
raw_args for request objects
2017-03-29 22:06:54 +01:00
Eli Uriegas
60eb528d68
Merge pull request #491 from r0fls/remove-stop-event
...
remove stop_event
2017-03-29 07:08:55 -05:00
Eli Uriegas
18405b3908
There was a line missing here?
2017-03-28 22:57:58 -05:00
Eli Uriegas
f0a55b5cbb
Fix line length again...
2017-03-28 22:51:23 -05:00
Eli Uriegas
04a0774ee5
Fix line length
2017-03-28 22:51:23 -05:00
Eli Uriegas
511998d8e1
Merge pull request #573 from r0fls/env-config
...
allow setting config from individual env variables
2017-03-28 22:24:37 -05:00
Jakob Bowyer
42ba5298a7
Flake8 cleanup. Setup environmental variables.
...
Skipping broken tests unrelated.
2017-03-28 10:50:09 +01:00
Raphael Deem
fc69678206
Merge remote-tracking branch 'upstream/master' into remove-stop-event
2017-03-26 15:59:31 -07:00
Raphael Deem
aebd717039
fix merge conflict
2017-03-26 15:49:58 -07:00
Raphael Deem
1ddb01ac44
remove stop_event
2017-03-26 15:48:41 -07:00
Raphael Deem
c5b50fe3cf
allow setting config from individual env variables
2017-03-25 17:45:55 -07:00
Raphael Deem
df9884de3c
Merge pull request #576 from matuusu/master
...
fix http status code not propagating in response
2017-03-24 19:23:20 -07:00
Raphael Deem
179606feb1
Merge pull request #590 from r0fls/blueprint-strict-slash
...
add blueprint strict_slashes
2017-03-23 18:42:21 -07:00
Raphael Deem
5d293df64b
add blueprint strict_slashes
2017-03-23 18:37:06 -07:00
skytoup
fdbf452ced
1. try...catch aiohttp encode response body to text in test_client
...
2. add tests static binary file
2017-03-23 15:22:00 +08:00
Raphael Deem
1456b128d2
Merge pull request #572 from sourcepirate/master
...
Removed raw string in cookies documentation
2017-03-22 14:55:20 -07:00
matuusu
9c15982299
Update response.py
...
fix status code not propagating from response.stream to response.StreamingHTTPResponse
2017-03-22 12:40:40 +01:00
sourcepirate
63c24122db
Removed raw string in cookies documentation
2017-03-22 06:39:23 +05:30
messense
1396ca903d
Fix before_stop event
2017-03-20 14:27:02 +08:00
messense
d1fb5bdc30
Fix async before_server_start hook bug
2017-03-20 14:25:32 +08:00
messense
e27812bf3e
Set signal.stopped = True
on closing
2017-03-20 14:25:32 +08:00
messense
11a3cf9b99
Add signal handling
2017-03-20 14:25:32 +08:00
messense
a90d70feae
Check connections is not None
2017-03-20 14:25:32 +08:00
messense
466b34735c
Set app.is_running to True
2017-03-20 14:25:32 +08:00
messense
7ca9116e37
Trigger before_stop before closing server, after_stop before closing
...
loop
2017-03-20 14:25:31 +08:00
messense
decd3e737c
Flake8 fix
2017-03-20 14:25:31 +08:00
messense
f35442ad1b
Fix RuntimeError: this event loop is already running
2017-03-20 14:25:31 +08:00
messense
2b296435b3
Trigger events
2017-03-20 14:25:31 +08:00
messense
19ee1dfecc
Gunicorn worker
2017-03-20 14:25:31 +08:00
Raphael Deem
43c4fc8e33
Merge pull request #559 from r0fls/557
...
accept strict_slash routes
2017-03-17 13:10:26 -07:00
Raphael Deem
46677e69ce
accept strict_slash routes
2017-03-16 11:46:07 -07:00
Eli Uriegas
5fbca5b823
Merge pull request #561 from kdelwat/master
...
Fix ReadTheDocs build errors
2017-03-16 09:02:39 -05:00
Cadel Watson
d713533d26
Fix docstring formatting errors
2017-03-16 16:52:18 +11:00
Miguel Grinberg
fd823c63ab
cancel websocket tasks if server is stopped
2017-03-15 22:45:19 -07:00
Jing Su
250bb7e29d
add websocket secure scheme in request @messense
2017-03-13 18:34:43 +08:00
Jing Su
3af26540ec
add websocket scheme in request
2017-03-13 13:28:35 +08:00
Raphael Deem
01a770cbca
windows setup
2017-03-11 19:32:38 -08:00
Raphael Deem
0eedde445c
remove default host attribute in router
2017-03-11 15:39:48 -08:00
Raphael Deem
88bf78213f
Merge pull request #512 from subyraman/fix-url-building
...
Fix `request.url` and other url properties
2017-03-10 00:38:16 -08:00
Raphael Deem
dffaaf8751
Merge pull request #533 from 38elements/patch-1
...
Fix bail_out()
2017-03-10 00:35:54 -08:00
Raphael Deem
313edadf47
Merge pull request #528 from r0fls/523
...
allow running with SSL via commandline
2017-03-10 00:35:46 -08:00
Raphael Deem
c9ce33dfe6
Merge pull request #524 from r0fls/exception-list
...
allow exceptions to be a list
2017-03-10 00:35:38 -08:00
Raphael Deem
0f50ac7205
Merge pull request #517 from r0fls/empty-json
...
return valid json in request.json
2017-03-10 00:35:26 -08:00
38elements
313535c599
Fix bail_out()
2017-03-09 13:36:01 +09:00
Raphael Deem
2ba30f2022
allow running with SSL via commandline
2017-03-07 19:57:10 -08:00
Raphael Deem
90138c4bae
return valid json in request.json
2017-03-07 18:03:45 -08:00
Raphael Deem
58a833e987
rename TestClient
2017-03-07 17:13:23 -08:00
Raphael Deem
86c5a569d5
allow exceptions to be a list
2017-03-07 16:22:23 -08:00
Eli Uriegas
19592e8eea
Merge pull request #473 from subyraman/explore-streams-v2
...
Add `stream` method for streaming content, add docs and examples
2017-03-05 17:51:44 -08:00
Eli Uriegas
8e6678d526
Merge pull request #469 from miguelgrinberg/websocket-support
...
websocket support
2017-03-05 17:42:49 -08:00
Suby Raman
e792a1e030
add host test
2017-03-03 14:51:13 -05:00
Suby Raman
b40f30f2e5
fix tests
2017-03-03 11:49:35 -05:00
Suby Raman
1fbde87ec2
initial commit
2017-03-03 11:44:50 -05:00
(Zenix) Han-Sheng Huang
62bf213a6e
pass flake8
2017-03-02 13:42:55 +09:00
(Zenix) Han-Sheng Huang
e5c32e9b48
special handling when sock is provided and number of workers > 1
2017-03-02 13:27:52 +09:00
Raphael Deem
002d4cb37c
Revert "add reuse_port to create_server"
...
This reverts commit c3386dec84
.
2017-02-28 19:27:42 -08:00
Raphael Deem
c3386dec84
add reuse_port to create_server
2017-02-28 19:21:53 -08:00
Eli Uriegas
9fcf725061
Increment version to 0.4.1
2017-02-28 08:55:04 -06:00
Eli Uriegas
601e015f00
Merge pull request #495 from r0fls/494
...
fix routing issue with slashes
2017-02-28 08:54:15 -06:00
James Stidard
104a7c7d05
Added app to websocket request ( #1 )
2017-02-27 22:35:28 -08:00
Miguel Grinberg
7560660ec7
handle timeouts and disconnects properly
2017-02-27 22:35:28 -08:00
Miguel Grinberg
f90288f5dc
websocket routes in blueprints
2017-02-27 22:35:28 -08:00
Miguel Grinberg
1d6e11ca10
addressed feedback
2017-02-27 22:35:28 -08:00
Miguel Grinberg
6e903ee7d5
websocket support, using websockets package
2017-02-27 22:35:28 -08:00
Raphael Deem
21fb1dff7e
fix routing issue with slashes
2017-02-27 20:01:11 -08:00
Raphael Deem
2dca53a696
remove stop_event
2017-02-26 16:37:48 -08:00
Eli Uriegas
42e1d18470
Increment version to 0.4.0
2017-02-25 13:36:47 -06:00
Raphael Deem
66c380548b
use getattr for request url in error handler
2017-02-23 23:17:31 -08:00
lixxu
28c31359bf
bug: url / will be empty
2017-02-24 00:45:50 +08:00
lixxu
ff3d33d5e0
bug: url_for in blueprint may have // at the beginning
2017-02-24 00:17:43 +08:00
Eli Uriegas
d015d6b103
Merge pull request #476 from seemethere/inject_app_into_request
...
Inject app into request object
2017-02-23 09:12:41 -06:00
messense
fedd7920a8
Fix exception collection typo
2017-02-23 10:39:14 +08:00
Eli Uriegas
56ecb6a3ea
Inject app into request object
...
Allows for injection of the app object into the request object through
the request handler.
This allows for users to setup things like database connections etc. in
listeners and then utilize them throughout the their various route
handlers.
Usage is fairly simple like so:
```python
@app.get('/')
async def handler(request):
request.app.anything
```
Name is up in the air but I'll leave this up for a few days and I'll
change it if we get a consensus
2017-02-22 11:34:14 -06:00
Eli Uriegas
64f73f624f
Merge pull request #471 from r0fls/vhost-default
...
allow default vhost
2017-02-22 11:08:28 -06:00
Suby Raman
d8a6d7e02f
response.write should be synchronous for performance reasons
2017-02-22 10:42:16 -05:00
Suby Raman
fa13ad8849
clean up imports
2017-02-21 11:36:45 -05:00
Suby Raman
8b23dec322
improve performance
2017-02-21 11:28:45 -05:00
Suby Raman
4e8aac4b41
rebase
2017-02-21 11:05:06 -05:00
Raphael Deem
9c72b557ec
allow default vhost
2017-02-20 16:52:36 -08:00
Raphael Deem
207ec1e032
route logic for trailing slash
2017-02-20 16:11:28 -08:00
hhstore
26c9618e63
fix import path.
2017-02-20 17:57:15 +08:00
Eli Uriegas
2c2a28e46b
Add better error message around app.loop
2017-02-18 12:29:25 -06:00
Eli Uriegas
c75d484f23
Merge branch 'master' of github.com:channelcat/sanic into add_app_loop_safety
2017-02-17 07:10:59 -06:00
Eli Uriegas
0b914866eb
Merge pull request #401 from youknowone/error-logging
...
Enhance error logging
2017-02-17 07:01:40 -06:00
Eli Uriegas
55dc45de33
Merge pull request #455 from seemethere/add_better_response_error_detection
...
Adds some safety around response types being wrong
2017-02-17 06:59:52 -06:00
Eli Uriegas
39aa64ff68
Remove un-needed loop assignment
2017-02-17 06:57:41 -06:00
Eli Uriegas
94bb91f2fa
Adds some safety around app loop property
2017-02-17 06:54:26 -06:00
Jeong YunWon
b44e8167d7
Enhance error logging
...
- Prevent to fall into error logging recursion when it doesn't have
request info (Print 'Unknown' when the request is still `None`
- Print repr(e) rather than str(e)
2017-02-17 14:05:46 +09:00
Eli Uriegas
ad13529eaa
Removes the extra logging message for run
...
Solves for #456
2017-02-16 21:51:19 -06:00
Eli Uriegas
04c8f4a5ed
Adds some safety around response types being wrong
...
Before we didn't check if the response object was actually a response
object. This PR catches the exception should it happen and reports it to
the user.
2017-02-16 17:49:14 -06:00
Eli Uriegas
865506546f
Merge pull request #440 from r0fls/isinstance
...
isinstance -> try/except
2017-02-16 17:19:04 -06:00
Eli Uriegas
fe72fadedd
Merge pull request #432 from agoose77/cleanups
...
Bugfix & simplfication for host based routing
2017-02-16 17:18:24 -06:00
Eli Uriegas
483b442b7d
Default request.args to RequestParameters
2017-02-16 15:54:20 -06:00
Alec Buckenheimer
f9ab24a077
#449 use stdlib json module if ujson is unavailible
2017-02-16 15:03:52 -05:00
Raphael Deem
6726affa7e
isinstance -> try/except
2017-02-15 19:34:45 -08:00
Eli Uriegas
6ecf2a6eb2
Merge pull request #439 from seemethere/move_sanic_to_app
...
Moves sanic/sanic.py to sanic/app.py
2017-02-15 21:03:41 -06:00
Eli Uriegas
a359e11f97
Merge pull request #422 from r0fls/420
...
move logging to method in ErrorHandler
2017-02-15 21:03:15 -06:00
Eli Uriegas
54b2d74068
Get rid of relative imports
2017-02-15 20:54:00 -06:00
Eli Uriegas
c99aa7279b
Moves sanic/sanic.py to sanic/app.py
...
Functionality wise this won't change much for most users, unless you
were directly importing from `sanic.sanic` in which case I am sorry if
you're affected by this.
Main motivation was because jedi autocompletion didn't work with this
and we were using relative imports to compensate for the fact that
having a module inside of your module with the same name creates major
namespace problems.
2017-02-15 20:47:34 -06:00
Eli Uriegas
874698b93f
Merge pull request #431 from subyraman/test-client-v2
...
Add Flask-like `test_client` to replace `sanic_endpoint_test`
2017-02-15 15:44:30 -06:00
Raphael Deem
1cf1024332
Merge branch 'master' into 420
2017-02-15 09:29:52 -08:00
Raphael Deem
efc90f8f5a
Merge pull request #434 from agoose77/fix_warn_error
...
Fix mistake in warning
2017-02-14 16:46:37 -08:00
Angus Hollands
6535ba7c24
Fix mistake in warning
2017-02-14 20:53:55 +00:00
Angus Hollands
5c29c3d160
Merge branch 'master' of https://github.com/channelcat/sanic into cleanups
2017-02-14 20:47:28 +00:00
Angus Hollands
742d4bff78
Change to iterable as Python3.5 doesn't support Collection.
...
We don't really need the getitem and len attributes anyway
2017-02-14 20:46:14 +00:00
Angus Hollands
b442d78ebb
Bugfix & simplfication for host based routing (if list of hosts passed after a previous vhost route was added, previously attempted to add set to set)
...
Add comment documenting substandard behaviour
2017-02-14 20:32:04 +00:00
Eli Uriegas
d44edb5930
Merge pull request #430 from aquacash5/master
...
Added raw response for bag o' bytes responses
2017-02-14 14:19:01 -06:00
Suby Raman
d5633b3705
fix deprecation message
2017-02-14 15:16:58 -05:00
Suby Raman
3b68dc72e7
rework testing
2017-02-14 14:51:20 -05:00
Angus Hollands
51611c3934
Pep8 cleanups ( #429 )
...
* PEP8 cleanups
* PEP8 cleanups (server.py)
* PEP8 cleanups (blueprints.py)
* PEP8 cleanups (config.py)
* PEP8 cleanups (cookies.py)
* PEP8 cleanups (handlers.py)
* PEP8 cleanups (request.py)
* PEP8 cleanups (response.py)
* PEP8 cleanups (router.py)
* PEP8 cleanups (sanic.py) #2
* PEP8 cleanups (server.py) #2
* PEP8 cleanups (static.py)
* PEP8 cleanups (utils.py)
* PEP8 cleanups (views.py)
Updated docstring
2017-02-14 13:10:19 -06:00
Kyle Blöm
747b7567d7
Changed docstring for raw response
2017-02-14 09:40:33 -08:00
Kyle Blöm
797891d6cf
Added raw response for bag o' bytes responses
2017-02-14 09:27:39 -08:00
Eli Uriegas
286dc3c32b
Merge pull request #399 from lixxu/master
...
improve url_for to support multi values and special options
2017-02-14 10:27:54 -06:00
Eli Uriegas
b139810b6a
Merge pull request #424 from growingdever/blueprint-support-view
...
support view instance for blueprint add_route method
2017-02-14 10:26:05 -06:00
Angus Hollands
56f56d008a
Simplify trigger events (now guaranteeed to receive list of events)
...
Don't bother checking if list empty - this function is not called often
2017-02-14 15:15:15 +00:00
growingdever
81a8a99b6e
wrap over width comment
2017-02-14 17:20:39 +09:00
growingdever
07aa0ee7ad
- copy codes from Sonic.add_route
...
- modify comment by r0fls
2017-02-14 17:15:38 +09:00
growingdever
b66a6bddbc
fix typo
2017-02-14 14:30:07 +09:00
growingdever
d57d90fe6b
- make blueprint add_route method support view instance
...
- update documentation that doesn't specify url_prefix parameter
2017-02-14 14:23:22 +09:00
Raphael Deem
de6c646ee8
move logging to method in ErrorHandler
2017-02-13 19:44:54 -08:00
lixxu
4839ede64f
update test for url_for and update routing.md doc
2017-02-14 10:26:30 +08:00
Raphael Deem
7a3f5d508b
fix merge conflicts
2017-02-13 14:19:44 -08:00
Eli Uriegas
1660041470
Merge pull request #408 from agoose77/master
...
Use app decorator instead of run arguments for before_start
2017-02-13 12:54:46 -06:00
Suby Raman
b2be821637
reverse router changes
2017-02-13 11:55:00 -05:00
Suby Raman
051ff2b325
remove repr stuff
2017-02-13 11:50:09 -05:00
Suby Raman
4d6f9ffd7c
rebase
2017-02-13 11:45:55 -05:00
Suby Raman
d614823013
rebase
2017-02-13 11:38:28 -05:00
Eli Uriegas
48aa51b739
Merge pull request #413 from r0fls/loop-signal-handlers
...
use try/except when adding loop sig handlers
2017-02-13 10:13:56 -06:00
Raphael Deem
41c6125e1b
use try/except when adding loop sig handlers
2017-02-12 14:43:00 -08:00
Eli Uriegas
bb3d48f98b
Merge pull request #412 from seemethere/improving_performance
...
Header performance gains
2017-02-12 15:48:45 -06:00
Raphael Deem
b5e46e83e2
ensure_future -> add_task
2017-02-12 12:29:12 -08:00
Angus Hollands
2340910b46
Update deprecation message
...
Fix bug with single callbacks
2017-02-12 18:15:14 +00:00
Eli Uriegas
d8c4c1525d
Merge pull request #406 from agoose77/master_pre_patches_1
...
Cleanup middleware decorator
2017-02-12 12:14:50 -06:00
Eli Uriegas
6713ef7726
Remove unused import
2017-02-12 12:09:06 -06:00
Eli Uriegas
ae7555b065
Performance was down so this brings it back up
...
Changes from #378 introduced about a 10k request/sec slowdown. This
tries to rememdy it while keeping the same functionality but it's still
not as fast as 0.3.1
2017-02-12 12:05:14 -06:00
Angus Hollands
ee6ff0cc60
Add deprecation and old API
2017-02-12 12:28:02 +00:00
Raphael Deem
94b2352c2c
add ensure_future method
2017-02-11 17:40:17 -08:00
Raphael Deem
0e1bb6ab04
add loop property
2017-02-11 16:28:35 -08:00
Angus Hollands
8b08a370c5
Remove todo
2017-02-11 14:39:32 +00:00
Angus Hollands
b5e50ecb75
Use app decorator instead of run arguments for before_start
...
Mirror listener of blueprints
2017-02-11 14:30:17 +00:00
Angus Hollands
e00c9d0ee0
Fix line length
2017-02-11 12:39:04 +00:00
Angus Hollands
be9c9f045a
Cleanup middleware decorator
2017-02-11 12:27:25 +00:00
lixxu
fb419eaa36
fix bug: netloc always in url if SERVER_NAME defined in config even _external not true
2017-02-09 18:26:17 +08:00
lixxu
cf2a363e5e
improve url_for to support multi values for one arg, add _anchor/_external/_scheme options
2017-02-09 16:44:23 +08: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
419156f7cc
Merge pull request #397 from seemethere/increment_031
...
Increment to v0.3.1
2017-02-08 19:23:20 -06:00
Eli Uriegas
b7f7883fb7
Increment to v0.3.1
2017-02-08 19:22:51 -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
Eli Uriegas
6724d8131c
Merge pull request #387 from subyraman/url-for-v3
...
Add `url_for` method for simple routes, blueprints, HTTPMethodView
2017-02-08 19:20:09 -06:00
Raphael Deem
a19bb15070
Merge pull request #389 from chenfengyuan/fix_run_async_demo
...
fix run_async demo
2017-02-07 14:58:48 -08:00
Eli Uriegas
2ee0147848
Merge pull request #386 from youknowone/sanic_endpoint_test
...
Fix sanic_endpoint_test working with redirects
2017-02-07 10:57:05 -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
36d519026f
reject unnamed handlers
2017-02-06 11:11:00 -05:00
Fengyuan Chen
aa54785918
fix always warning loop is passed issue
2017-02-06 11:11:00 -05:00
Jeong YunWon
a15ee3ad06
Fix sanic_endpoint_test working with redirects
...
Before fix, it raises error like:
```
tests/test_utils.py F
================================= FAILURES =================================
______________________________ test_redirect _______________________________
app = <sanic.sanic.Sanic object at 0x1045fda20>, method = 'get', uri = '/1', gather_request = True, debug = False
server_kwargs = {}, request_args = (), request_kwargs = {}
_collect_request = <function sanic_endpoint_test.<locals>._collect_request at 0x1045ec950>
_collect_response = <function sanic_endpoint_test.<locals>._collect_response at 0x1045ec7b8>
def sanic_endpoint_test(app, method='get', uri='/', gather_request=True,
debug=False, server_kwargs={},
*request_args, **request_kwargs):
results = []
exceptions = []
if gather_request:
def _collect_request(request):
results.append(request)
app.request_middleware.appendleft(_collect_request)
async def _collect_response(sanic, loop):
try:
response = await local_request(method, uri, *request_args,
**request_kwargs)
results.append(response)
except Exception as e:
exceptions.append(e)
app.stop()
app.run(host=HOST, debug=debug, port=PORT,
after_start=_collect_response, **server_kwargs)
if exceptions:
raise ValueError("Exception during request: {}".format(exceptions))
if gather_request:
try:
> request, response = results
E ValueError: too many values to unpack (expected 2)
sanic/utils.py:47: ValueError
During handling of the above exception, another exception occurred:
utils_app = <sanic.sanic.Sanic object at 0x1045fda20>
def test_redirect(utils_app):
"""Test sanic_endpoint_test is working for redirection"""
> request, response = sanic_endpoint_test(utils_app, uri='/1')
tests/test_utils.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
app = <sanic.sanic.Sanic object at 0x1045fda20>, method = 'get', uri = '/1', gather_request = True, debug = False
server_kwargs = {}, request_args = (), request_kwargs = {}
_collect_request = <function sanic_endpoint_test.<locals>._collect_request at 0x1045ec950>
_collect_response = <function sanic_endpoint_test.<locals>._collect_response at 0x1045ec7b8>
def sanic_endpoint_test(app, method='get', uri='/', gather_request=True,
debug=False, server_kwargs={},
*request_args, **request_kwargs):
results = []
exceptions = []
if gather_request:
def _collect_request(request):
results.append(request)
app.request_middleware.appendleft(_collect_request)
async def _collect_response(sanic, loop):
try:
response = await local_request(method, uri, *request_args,
**request_kwargs)
results.append(response)
except Exception as e:
exceptions.append(e)
app.stop()
app.run(host=HOST, debug=debug, port=PORT,
after_start=_collect_response, **server_kwargs)
if exceptions:
raise ValueError("Exception during request: {}".format(exceptions))
if gather_request:
try:
request, response = results
return request, response
except:
raise ValueError(
"Request and response object expected, got ({})".format(
> results))
E ValueError: Request and response object expected, got ([{}, {}, {}, <ClientResponse(http://127.0.0.1:42101/3 ) [200 OK]>
E <CIMultiDictProxy('Content-Type': 'text/plain; charset=utf-8', 'Content-Length': '2', 'Connection': 'keep-alive', 'Keep-Alive': 'timeout=1')>
E ])
sanic/utils.py:52: ValueError
```
2017-02-05 13:57:04 +09:00
Fengyuan Chen
29680cb515
fix always warning loop is passed issue
2017-02-04 16:09:09 +08:00
Fengyuan Chen
884749f345
fix run_async demo
2017-02-04 15:27:46 +08:00
Suby Raman
5632d073be
update docs
2017-02-02 13:00:15 -05:00
Suby Raman
f9056099f9
all works
2017-02-02 12:52:48 -05:00
Suby Raman
7c09ec29f7
rebase
2017-02-02 12:21:14 -05:00
Eli Uriegas
6f0b09509e
Merge pull request #213 from sfstpala/master
...
Make it possible to disable the logo by subclassing Config
2017-02-01 23:07:52 -06:00
Raphael Deem
b29f648148
typo: async_run -> run_async
2017-01-31 12:46:02 -08:00
Eli Uriegas
487e3352e4
Revert "fix async run, add tests"
...
This reverts commit 41da793b5a
.
2017-01-31 07:30:17 -06:00
Eli Uriegas
17a92a58b2
Merge pull request #369 from r0fls/fix-async-run
...
fix async run, add tests
2017-01-30 22:21:25 -06:00