File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -647,19 +647,17 @@ def __init__(
647
647
real_headers [hdrs .CONTENT_TYPE ] = content_type + "; charset=" + charset
648
648
body = text .encode (charset )
649
649
text = None
650
- else :
651
- if hdrs .CONTENT_TYPE in real_headers :
652
- if content_type is not None or charset is not None :
653
- raise ValueError (
654
- "passing both Content-Type header and "
655
- "content_type or charset params "
656
- "is forbidden"
657
- )
658
- else :
659
- if content_type is not None :
660
- if charset is not None :
661
- content_type += "; charset=" + charset
662
- real_headers [hdrs .CONTENT_TYPE ] = content_type
650
+ elif hdrs .CONTENT_TYPE in real_headers :
651
+ if content_type is not None or charset is not None :
652
+ raise ValueError (
653
+ "passing both Content-Type header and "
654
+ "content_type or charset params "
655
+ "is forbidden"
656
+ )
657
+ elif content_type is not None :
658
+ if charset is not None :
659
+ content_type += "; charset=" + charset
660
+ real_headers [hdrs .CONTENT_TYPE ] = content_type
663
661
664
662
super ().__init__ (status = status , reason = reason , headers = real_headers )
665
663
You can’t perform that action at this time.
0 commit comments