7167: loadConfig setupKeepclient do only one set at a time.
[arvados.git] / sdk / python / tests / keepstub.py
index e84230aaeecfeea3f948cd34b2b974f5fe1d3f51..ef724ed5c52130c76ca878a60d94a150ed044c12 100644 (file)
@@ -65,6 +65,15 @@ class Handler(BaseHTTPServer.BaseHTTPRequestHandler, object):
 
     def do_PUT(self):
         self.server._do_delay('request_body')
+
+        # The comments at https://bugs.python.org/issue1491 implies that Python
+        # 2.7 BaseHTTPRequestHandler was patched to support 100 Continue, but
+        # reading the actual code that ships in Debian it clearly is not, so we
+        # need to send the response on the socket directly.
+
+        self.wfile.write("%s %d %s\r\n\r\n" %
+                         (self.protocol_version, 100, "Continue"))
+
         data = self.rfile.read(int(self.headers.getheader('content-length')))
         datahash = hashlib.md5(data).hexdigest()
         self.server.store[datahash] = data