Update web-platform-tests to revision 66dc9c93f2c8ebd7c8fdc28fae20d92713c97806

This commit is contained in:
WPT Sync Bot 2019-06-26 10:22:48 +00:00
parent e488ea750b
commit 12f4ae132e
1651 changed files with 8123 additions and 14152 deletions

View file

@ -22,22 +22,22 @@ Python Handlers
Python handlers are functions which provide a higher-level API over
manually updating the response object, by causing the return value of
the function to provide (part of) the response. There are three
the function to provide (part of) the response. There are four
possible sets of values that may be returned::
(status, headers, content)
((status_code, reason), headers, content)
(status_code, headers, content)
(headers, content)
content
Here `status` is either a tuple (status code, message) or simply a
integer status code, `headers` is a list of (field name, value) pairs,
and `content` is a string or an iterable returning strings. Such a
function may also update the response manually. For example one may
use `response.headers.set` to set a response header, and only return
the content. One may even use this kind of handler, but manipulate
the output socket directly, in which case the return value of the
function, and the properties of the response object, will be ignored.
Here `status_code` is an integer status code, `headers` is a list of (field
name, value) pairs, and `content` is a string or an iterable returning strings.
Such a function may also update the response manually. For example one may use
`response.headers.set` to set a response header, and only return the content.
One may even use this kind of handler, but manipulate the output socket
directly, in which case the return value of the function, and the properties of
the response object, will be ignored.
The most common way to make a user function into a python handler is
to use the provided `wptserve.handlers.handler` decorator::