286
286
process_cgi_output(req, line + '\n', cgiflags)
289
# Check if CGI field-name is valid
290
CGI_SEPERATORS = set(['(', ')', '<', '>', '@', ',', ';', ':', '\\', '"',
291
'/', '[', ']', '?', '=', '{', '}', ' ', '\t'])
292
if any((char in CGI_SEPERATORS for char in name)):
294
if not cgiflags.gentle:
295
message = """An unexpected server error has occured."""
298
# Header contained illegal characters
299
message = """You printed an invalid CGI header. CGI header
300
field-names can not contain any of the following characters:
301
<code>( ) < > @ , ; : \\ " / [ ] ? = { } <em>SPACE
303
write_html_warning(req, message, warning=warning)
304
cgiflags.wrote_html_warning = True
305
# Handle the rest of this line as normal data
306
process_cgi_output(req, line + '\n', cgiflags)
289
309
# Read CGI headers
290
310
value = value.strip()
291
311
if name == "Content-Type":