File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -377,13 +377,15 @@ def inner_run_cgi(self):
377377 env ['QUERY_STRING' ] = query
378378 if hasattr (self .headers , 'get_content_type' ):
379379 # Python 3. We need the raw header contents.
380- env [ 'CONTENT_TYPE' ] = self .headers .get ('content-type' )
380+ content_type = self .headers .get ('content-type' )
381381 elif self .headers .typeheader is None :
382382 # Python 2.
383- env [ 'CONTENT_TYPE' ] = self .headers .type
383+ content_type = self .headers .type
384384 else :
385385 # Python 2.
386- env ['CONTENT_TYPE' ] = self .headers .typeheader
386+ content_type = self .headers .typeheader
387+ if content_type :
388+ env ['CONTENT_TYPE' ] = content_type
387389 length = self .headers .get ('content-length' )
388390 if length :
389391 env ['CONTENT_LENGTH' ] = length
You can’t perform that action at this time.
0 commit comments