mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Default to 200 response code even for POST
This commit is contained in:
parent
0621499d4b
commit
75753b5318
@ -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())
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user