Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#32389 closed Bug (fixed)

ResponseHeaders crashes when data is not a mapping.

Reported by: Illia Volochii Owned by: Illia Volochii
Component: HTTP handling Version: 3.2
Severity: Release blocker Keywords:
Cc: Tom Carrick Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

>>> from django.http.response import ResponseHeaders
>>> headers = ResponseHeaders((('X-Foo', 'bar'),))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "[...]/django/django/http/response.py", line 36, in __init__
    for k, v in CaseInsensitiveMapping._destruct_iterable_mapping_values(data)
AttributeError: type object 'CaseInsensitiveMapping' has no attribute '_destruct_iterable_mapping_values'

_destruct_iterable_mapping_values is used as a method of CaseInsensitiveMapping, but it is a separate function.

Change History (4)

comment:1 by Mariusz Felisiak, 3 years ago

Cc: Tom Carrick added
Component: UncategorizedHTTP handling
Severity: NormalRelease blocker
Summary: ResponseHeaders initialization crashes when provided data is an iterable of tuple pairsResponseHeaders crashes when data is not a mapping.
Triage Stage: UnreviewedAccepted
Version: master3.2

Thanks, good catch. PR

Bug in bcc2befd0e9c1885e45b46d0b0bcdc11def8b249.

comment:2 by Carlton Gibson, 3 years ago

Triage Stage: AcceptedReady for checkin

comment:3 by Carlton Gibson <carlton@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In 3c004075:

Fixed #32389 -- Fixed ResponseHeaders crash when data is not mapping.

comment:4 by Carlton Gibson <carlton.gibson@…>, 3 years ago

In f9b2b1bb:

[3.2.x] Fixed #32389 -- Fixed ResponseHeaders crash when data is not mapping.

Backport of 3c004075b1d4fe4aa1ffc3f7d699dd9525bc6c02 from master

Note: See TracTickets for help on using tickets.
Back to Top