Home | History | Annotate | Download | only in paste

Lines Matching refs:headers

111          the current ``environ`` or values from incoming headers. This
145 a sequence of headers which are required for proper
153 ``headers``
165 error-free substitution of environment variables and headers.
176 def __init__(self, detail=None, headers=None, comment=None):
178 assert isinstance(headers, (type(None), list)), (
179 "headers must be None or a list: %r"
180 % headers)
185 self.headers = headers or tuple()
187 assert headers and has_header(headers, req), (
189 "(got headers: %r)"
190 % (self.__class__.__name__, req, headers))
206 if self.headers:
207 for (k, v) in self.headers:
230 if self.headers:
231 headers = list(self.headers)
233 headers = []
236 replace_header(headers, 'content-type', 'text/html')
239 replace_header(headers, 'content-type', 'text/plain')
244 header_value(headers, 'content-type')
247 headers, 'content-type',
249 return headers, content
253 headers, content = self.prepare_content(environ)
255 resp.headers = resp.headers.fromlist(headers)
262 headers, content = self.prepare_content(environ)
264 headers,
311 if a location is not provided in the headers; it is assumed that the
322 def __init__(self, detail=None, headers=None, comment=None):
323 assert isinstance(headers, (type(None), list))
324 headers = headers or []
325 location = header_value(headers,'location')
329 headers.append(('location', location))
331 "location in the headers nor did it "
333 HTTPRedirection.__init__(self, location, headers, comment)
337 def relative_redirect(cls, dest_uri, environ, detail=None, headers=None, comment=None):
343 headers = headers or []
344 headers.append(('Location', location))
345 return cls(detail=detail, headers=headers, comment=comment)
350 for name, value in self.headers:
382 # @@: should include date header, optionally other headers
617 Note if the headers have already been sent, the stack trace is