diff --git a/src/calibre/srv/http_response.py b/src/calibre/srv/http_response.py index c0fc01204b..9628be6e1f 100644 --- a/src/calibre/srv/http_response.py +++ b/src/calibre/srv/http_response.py @@ -208,7 +208,7 @@ class RequestData(object): # {{{ ) self.remote_addr, self.remote_port = remote_addr, remote_port self.opts = opts - self.status_code = httplib.CREATED if self.method == 'POST' else httplib.OK + self.status_code = httplib.OK self.outcookie = Cookie() self.lang_code = self.gettext_func = self.ngettext_func = None self.set_translator(self.get_preferred_language()) diff --git a/src/calibre/srv/tests/http.py b/src/calibre/srv/tests/http.py index 5218964aea..6f8ca02c6c 100644 --- a/src/calibre/srv/tests/http.py +++ b/src/calibre/srv/tests/http.py @@ -206,14 +206,14 @@ class TestHTTP(BaseTest): # Test POST with simple body conn.request('POST', '/test', 'body') r = conn.getresponse() - self.ae(r.status, httplib.CREATED) + self.ae(r.status, httplib.OK) self.ae(r.read(), b'testbody') # Test POST with chunked transfer encoding conn.request('POST', '/test', headers={'Transfer-Encoding': 'chunked'}) conn.send(b'4\r\nbody\r\na\r\n1234567890\r\n0\r\n\r\n') r = conn.getresponse() - self.ae(r.status, httplib.CREATED) + self.ae(r.status, httplib.OK) self.ae(r.read(), b'testbody1234567890') # Test various incorrect input