Testing WebIOPi with apigee console lead to errors that have to do with partly
missing Content-Length header of HTTP responses.
This change fixes this.
http.py
def sendResponse(self, code, body=None, contentType="text/plain"):
if code >= 400:
if body != None:
self.send_error(code, body)
else:
self.send_error(code)
else:
self.send_response(code)
self.send_header("Cache-Control", "no-cache")
if body != None:
self.send_header("Content-Type", contentType);
encodedBody = body.encode(); # Added Rgg
self.send_header("Content-Length", len(encodedBody)); # Added Rgg
self.end_headers();
self.wfile.write(encodedBody) # Changed Rgg
self.logRequest(code)
Maybe coap.py also needs this kind of change but I did not look at this one so
far.
Andreas
Original issue reported on code.google.com by andreas....@googlemail.com on 9 Feb 2014 at 11:33
Original issue reported on code.google.com by
andreas....@googlemail.com
on 9 Feb 2014 at 11:33