@@ -247,6 +247,10 @@ def clean_attachment_link(link, force_shva=False):
def minify_result(result):
+ result['parsed_text'] = html_minify(result['parsed_text'])
+ result['parsed_text'] = strip_html_head_body(result['parsed_text'])
+
+def strip_html_head_body(parsed_text):
# [25:-14] trims <html><head></head><body> and </body></html>
- result['parsed_text'] = html_minify(result['parsed_text'].encode('utf-8'))
- result['parsed_text'] = result['parsed_text'][25:-14]
+ return parsed_text[25:-14]
@@ -181,7 +181,7 @@ def create_user_with_form(strategy, details, backend, user=None, *args, **kwargs
if request.method == 'POST':
try:
- request_data = json.loads(request.body.decode('utf-8'))
+ request_data = json.loads(request.body)
except (TypeError, ValueError):
request_data = request.POST.copy()