MCPcopy
hub / github.com/benoitc/gunicorn / default_headers

Method default_headers

gunicorn/http/wsgi.py:391–409  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

389 return True
390
391 def default_headers(self):
392 # set the connection header
393 if self.upgrade:
394 connection = "upgrade"
395 elif self.should_close():
396 connection = "close"
397 else:
398 connection = "keep-alive"
399
400 headers = [
401 "HTTP/%s.%s %s\r\n" % (self.req.version[0],
402 self.req.version[1], self.status),
403 "Server: %s\r\n" % self.version,
404 "Date: %s\r\n" % util.http_date(),
405 "Connection: %s\r\n" % connection
406 ]
407 if self.chunked:
408 headers.append("Transfer-Encoding: chunked\r\n")
409 return headers
410
411 def send_headers(self):
412 if self.headers_sent:

Callers 2

send_headersMethod · 0.95

Calls 1

should_closeMethod · 0.95

Tested by 1