Commit Graph

49 Commits

Author SHA1 Message Date
Andrew Godwin
fd30bff5de Fixed #483: HttpResponse takes "status", not "status_code" 2017-01-13 09:32:41 -08:00
Artem Skoretskiy
387c73fa27 Fixed import to resolve RemovedInDjango20Warning (#457)
* Fixed import to resolve RemovedInDjango20Warning

That resolves: "RemovedInDjango20Warning: Importing from django.core.urlresolvers is deprecated in favor of django.urls."

* Fixed syntax error

Fixed indent

* Updated import order
2017-01-02 08:14:34 -08:00
Andrew Godwin
5a38171fc7 Fix #449: root_path was ending up as None 2016-12-10 11:48:11 -08:00
Jan Boysen
fdc80cb269 runserver should respect FORCE_SCRIPT_NAME setting (#435)
* Pass FORCE_SCRIPT_NAME to Daphne server when set

FORCE_SCRIPT_NAME seems not to be honored any more with build-in runserver after activating channels app.
The normal behavior of Django is the FORCE_SCRIPT_NAME is used as prefix when set while generating URLs so its possible to
create a path prefix and determine different Django installations based on the path rather than hostname without having to prefix all paths in urls.py.

* Only strip script_name from path if it starts with it

* make tests happy again after setting kwarg root_path
2016-11-18 06:26:16 -08:00
Paul
f4f45dbb9f Sort imports and make Travis run isort (#425)
* Sort imports

* Make Travis run isort
2016-11-05 12:08:38 +01:00
Andrew Godwin
6d8d3214e6 Fixed #422: No SERVER_PORT in request.META causes errors 2016-11-02 08:15:06 +00:00
Luke Hodkinson
1673be5b75 Found a bug whereby streaming responses would try to be cached (#396)
entirely in memory. Was causing views that stream a lot of data
to timeout.
2016-10-11 22:32:45 -07:00
Carles Barrobés
d4f7125cd5 Fix type for request.META['SERVER_PORT'] (#378)
Django documentation states that it is a string.
Fixes #366
2016-09-23 11:37:45 -07:00
Benjamin Bach
06fd1f8ada Add conventional request.META['PATH_INFO'] - fixes benjaoming/django-nyt#27 (#375) 2016-09-22 13:57:30 -07:00
Andrew Godwin
f699d112b0 Fixed #309: Missed a double decode for header coalescing 2016-08-23 20:10:15 -07:00
Andrew Godwin
a05f7d5a96 Fixed #160: _read_started set to False on request
This allows read_post_and_files to work.
2016-07-12 14:40:19 -07:00
Andrew Godwin
92012fbc27 Fixed #87: Don't drop headers and status on empty streaming responses 2016-06-29 12:20:47 -07:00
Vikalp Jain
2e3e39cd6c Update handler.py (#217)
Remove unnecessary comment
2016-06-22 13:01:39 -07:00
Andrew Godwin
e890c48f3f Fixed #210: Fix query string to be bytes and not decoded 2016-06-22 09:44:10 -07:00
Andrew Godwin
6ea6dc6576 Fixed #210: Plus double-decoded for query string 2016-06-21 08:04:16 -07:00
Tim Watts
56104e7fc6 Tests for file and streaming response handling inside Django (#185)
* add first streaming and file response tests

* iterate over response and not streaming content directly

* add coverage for FileResponse and StreamingHttpResponse

* added tests for headers, json responses, and redirect responses

* rm print statement

* skip failing stringio test
2016-06-01 09:47:50 -07:00
Andrew Godwin
38641d8522 Fixed #182: Close response once we're done with it 2016-05-31 19:04:12 +00:00
Andrew Godwin
feea84f323 Introduce backpressure with ChannelFull 2016-05-05 22:48:12 -07:00
Andrew Godwin
45dfeb548e Django 1.10 patch fixes 2016-05-03 18:10:51 -07:00
Andrew Godwin
e684b27e46 Switch to uncode path and query string for HTTP 2016-04-26 13:33:26 +01:00
Michael Kutý
80206e5452 Fix loading files. #123 2016-04-08 11:04:55 -07:00
Andrew Godwin
d29f02fb33 Patchinator/django fixes 2016-04-05 16:20:49 -07:00
David Evans
28e897d9bc Remove lazy loading of middleware
This mirrors the equivalent change in Django itsef. See:

https://code.djangoproject.com/ticket/26452

99bb7fcc18
2016-04-04 13:36:18 -07:00
Andrew Godwin
67e3e55131 Respect HTTP request body close in ASGI. 2016-04-04 03:34:05 +02:00
Andrew Godwin
920882f1da Implement timeout on request body reading 2016-04-04 03:34:05 +02:00
Andrew Godwin
f829a14312 Don't show last-chance traceback when DEBUG is off. 2016-03-23 12:53:02 -07:00
Andrew Godwin
7bc94b342e Implement last-resort error handler for HTTP requests
There's no WSGI server to do this for us, so Channels has to.
2016-03-23 11:50:35 -07:00
Andrew Godwin
52c821a186 Increase FileResponse block size everywhere, not just staticfiles 2016-03-22 10:31:37 -07:00
Andrew Godwin
8faf37bfbf Fix type of cookie header string 2016-03-16 09:50:15 -03:00
Andrew Godwin
5bf19f52f6 Remove status_text from the HTTP response spec. 2016-03-11 10:30:40 -08:00
Andrew Godwin
820e955515 Change ASGI spec regarding headers. 2016-03-11 10:20:17 -08:00
Andrew Godwin
38c6df8125 Move ResponseLater into exceptions module 2016-02-24 00:39:48 +00:00
Andrew Godwin
247a26b91a Fix streaming responses (e.g. staticfiles.serve) 2016-02-20 23:32:01 +00:00
Andrew Godwin
171b9d8552 Add META['SCRIPT_NAME'] for backwards compat 2016-02-20 22:47:35 +00:00
Andrew Godwin
5c9093ddeb Fix bug with sending empty response 2016-02-14 21:26:34 +00:00
Andrew Godwin
be1498768f HTTP Long Poll finishing off 2016-02-14 19:22:46 +00:00
Andrew Godwin
b468ddd930 More flake fixes 2016-02-10 20:37:57 +00:00
Andrew Godwin
41b6750afb Do much more runserver-like logging 2016-02-10 20:26:56 +00:00
Andrew Godwin
fee6a38483 Handle request body encoding 2016-02-10 19:50:36 +00:00
Andrew Godwin
1a7010aa2c Make _stream work on AsgiRequest 2016-02-10 19:15:00 +00:00
Andrew Godwin
49cbf31872 Fix more python 3 unicode issues 2016-02-09 13:32:37 -08:00
Andrew Godwin
aff9ca2f13 Update runserver to autoreload w/daphne in main thread 2016-02-09 13:01:46 -08:00
Andrew Godwin
b7b11cb075 Remove sneaky print 2016-02-05 16:47:43 -08:00
Andrew Godwin
fa58375a51 Python 3 fixes 2016-02-05 16:47:11 -08:00
Andrew Godwin
1dab70ed86 Update CI config a bit more. 2016-02-05 16:22:58 -08:00
Andrew Godwin
5cd2cbdfee Add test suite for ASGI handlers 2016-02-05 15:53:01 -08:00
Andrew Godwin
5348c52778 Fixed #33: Add wsgi.multi* variables for back compat. 2016-01-02 18:35:43 -08:00
Andrew Godwin
d452486524 Correct body/POST handling 2016-01-02 18:10:25 -08:00
Andrew Godwin
b9464ca149 Start making channels work to ASGI spec. 2016-01-02 10:17:45 -08:00