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 @@ -630,19 +630,17 @@ def __init__(
630
630
real_headers [hdrs .CONTENT_TYPE ] = content_type + "; charset=" + charset
631
631
body = text .encode (charset )
632
632
text = None
633
- else :
634
- if hdrs .CONTENT_TYPE in real_headers :
635
- if content_type is not None or charset is not None :
636
- raise ValueError (
637
- "passing both Content-Type header and "
638
- "content_type or charset params "
639
- "is forbidden"
640
- )
641
- else :
642
- if content_type is not None :
643
- if charset is not None :
644
- content_type += "; charset=" + charset
645
- real_headers [hdrs .CONTENT_TYPE ] = content_type
633
+ elif hdrs .CONTENT_TYPE in real_headers :
634
+ if content_type is not None or charset is not None :
635
+ raise ValueError (
636
+ "passing both Content-Type header and "
637
+ "content_type or charset params "
638
+ "is forbidden"
639
+ )
640
+ elif content_type is not None :
641
+ if charset is not None :
642
+ content_type += "; charset=" + charset
643
+ real_headers [hdrs .CONTENT_TYPE ] = content_type
646
644
647
645
super ().__init__ (status = status , reason = reason , headers = real_headers )
648
646
You can’t perform that action at this time.
0 commit comments