From 74da3d64e828a7c7a9bfb3f3561a7da449d05990 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 19 Nov 2013 10:22:36 -0500 Subject: [PATCH] Change the html explorer to defer status code until end to allow for error code 500 to work --- confluent/httpapi.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/confluent/httpapi.py b/confluent/httpapi.py index 318f4757..05264171 100644 --- a/confluent/httpapi.py +++ b/confluent/httpapi.py @@ -235,13 +235,15 @@ def resourcehandler(env, start_response): start_response('400 Bad Request', headers) yield '400 - Bad Request' return - start_response('200 OK', headers) + pagecontent = "" if mimetype == 'text/html': for datum in _assemble_html(hdlr, resource, querydict, url): - yield datum + pagecontent += datum else: for datum in _assemble_json(hdlr, resource, url): - yield datum + pagecontent += datum + start_response('200 OK', headers) + yield pagecontent def _assemble_html(responses, resource, querydict, url):