diff options
| author | Tom Carrick <tom@carrick.eu> | 2020-09-15 12:43:37 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-10-07 09:19:57 +0200 |
| commit | dcb69043d0de45bb55998fc418d93c28bc7689ae (patch) | |
| tree | ac58b959d8b749965841721e6cc2a58784bb51c3 /django/template | |
| parent | 2e7cc95499f758a1c4aa036cbf1dcddf82a89ea2 (diff) | |
Fixed #32002 -- Added headers parameter to HttpResponse and subclasses.
Diffstat (limited to 'django/template')
| -rw-r--r-- | django/template/response.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/django/template/response.py b/django/template/response.py index 30b35b611c..9efadcd726 100644 --- a/django/template/response.py +++ b/django/template/response.py @@ -11,7 +11,7 @@ class SimpleTemplateResponse(HttpResponse): rendering_attrs = ['template_name', 'context_data', '_post_render_callbacks'] def __init__(self, template, context=None, content_type=None, status=None, - charset=None, using=None): + charset=None, using=None, headers=None): # It would seem obvious to call these next two members 'template' and # 'context', but those names are reserved as part of the test Client # API. To avoid the name collision, we use different names. @@ -33,7 +33,7 @@ class SimpleTemplateResponse(HttpResponse): # content argument doesn't make sense here because it will be replaced # with rendered template so we always pass empty string in order to # prevent errors and provide shorter signature. - super().__init__('', content_type, status, charset=charset) + super().__init__('', content_type, status, charset=charset, headers=headers) # _is_rendered tracks whether the template and context has been baked # into a final response. @@ -139,6 +139,6 @@ class TemplateResponse(SimpleTemplateResponse): rendering_attrs = SimpleTemplateResponse.rendering_attrs + ['_request'] def __init__(self, request, template, context=None, content_type=None, - status=None, charset=None, using=None): - super().__init__(template, context, content_type, status, charset, using) + status=None, charset=None, using=None, headers=None): + super().__init__(template, context, content_type, status, charset, using, headers=headers) self._request = request |
