def start_response(status, response_headers, exc_info=None): status_code[0] = status.split()[0] if exc_info: try: if headers_sent: # Re-raise original exception if headers sent raise exc_info[0], exc_info[1], exc_info[2] finally: # Avoid dangling circular ref exc_info = None capitalized_headers = [('-'.join([x.capitalize() for x in key.split('-')]), value) for key, value in response_headers] headers_set[:] = [status, capitalized_headers] return write
如果调用eventlet.wsgi来开启服务,那么最上层的start_response函数就是这个,值得注意的就是
capitalized_headers,
换言之,在整个应用的header都会被格式化成Content-Type这种首字母大写的格式。