diff options
Diffstat (limited to 'net/tools')
-rwxr-xr-x | net/tools/testserver/testserver.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py index a222558..36e0a89 100755 --- a/net/tools/testserver/testserver.py +++ b/net/tools/testserver/testserver.py @@ -286,6 +286,7 @@ class TestPageHandler(BasePageHandler): self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, + self.NoContentHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.MultipartHandler, @@ -1070,6 +1071,14 @@ class TestPageHandler(BasePageHandler): self.wfile.write("<html>\n<body>\n<p>HTML text</p>\n</body>\n</html>\n"); return True + def NoContentHandler(self): + """Returns a 204 No Content response.""" + if not self._ShouldHandleRequest("/nocontent"): + return False + self.send_response(204) + self.end_headers() + return True + def ServerRedirectHandler(self): """Sends a server redirect to the given URL. The syntax is '/server-redirect?http://foo.bar/asdf' to redirect to |