Skip to content
Myr

make content-type's charset information case-insensitive

Before adoption: this commit came in with the history the project adopted, so no landing records it.

see issue https://github.com/requests/requests/issues/4748 for more information

authored by Lucy Linder · committed by Lucy Linder · parent 6686ac1 · Browse files · 2 files+5 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+5 added−1 removed

  • tests:+4 added−0 removed
  • other:+1 added−1 removed

2 files+5 added−1 removed

modified:requests/utils.py+1 added-1 removed
464 unmodified lines
465 index_of_equals = param.find("=")466 if index_of_equals != -1:467 key = param[:index_of_equals].strip(items_to_strip)468 value = param[index_of_equals + 1:].strip(items_to_strip)469 params_dict[key] = value469 params_dict[key.lower()] = value470 return content_type, params_dict471472473def get_encoding_from_headers(headers):
503 unmodified lines
modified:tests/test_utils.py+4 added
479 unmodified lines
480 'application/json ; charset=utf-8',481 ('application/json', {'charset': 'utf-8'})482 ),483 (484 'application/json ; Charset=utf-8',485 ('application/json', {'charset': 'utf-8'})486 ),487 (488 'text/plain',489 ('text/plain', {})490 ),491 (
290 unmodified lines