0001-misc-allow-new-request.headers-usage-69809.patch
wcs/compat.py | ||
---|---|---|
62 | 62 |
response = HttpResponse(body) |
63 | 63 |
response.status_code = self.quixote_response.status_code |
64 | 64 |
response.reason_phrase = self.quixote_response.reason_phrase |
65 |
elif request.META.get('HTTP_X_POPUP') == 'true':
|
|
65 |
elif request.headers.get('X-Popup') == 'true':
|
|
66 | 66 |
response = HttpResponse('<div class="popup-content">%s</div>' % context['body']) |
67 | 67 |
elif 'raw' in (getattr(self.quixote_response, 'filter') or {}): |
68 | 68 |
# used for theme preview (generated in /backoffice/ but cannot |
... | ... | |
143 | 143 |
return output |
144 | 144 |
if not hasattr(response, 'filter') or not response.filter: |
145 | 145 |
return output |
146 |
if request.META.get('HTTP_X_POPUP') == 'true':
|
|
146 |
if request.headers.get('X-Popup') == 'true':
|
|
147 | 147 |
return '<div class="popup-content">%s</div>' % output |
148 | 148 |
if response.filter and response.filter.get('admin_ezt'): |
149 | 149 |
return self.render_response(output) |
wcs/qommon/http_request.py | ||
---|---|---|
20 | 20 |
import time |
21 | 21 | |
22 | 22 |
import quixote.http_request |
23 |
from django.http.request import HttpHeaders |
|
23 | 24 |
from django.utils.encoding import force_bytes, force_text |
24 | 25 |
from quixote import get_publisher, get_session |
25 | 26 |
from quixote.errors import RequestError |
... | ... | |
238 | 239 |
def META(self): |
239 | 240 |
return self.environ |
240 | 241 | |
242 |
@property |
|
243 |
def headers(self): |
|
244 |
return HttpHeaders(self.META) |
|
245 | ||
241 | 246 |
def trace(self, msg): |
242 | 247 |
print('%.4f' % (time.time() - self.t0), msg) |
243 |
- |