Ticket #28271: 0001-technical_500_response-utf-8-encoding-for-AJAX-reque.patch

File 0001-technical_500_response-utf-8-encoding-for-AJAX-reque.patch, 1.0 KB (added by Sergey Tereschenko, 7 years ago)
  • django/views/debug.py

    From 0ee9eb5de9e12a9789ce0d1688c26d3b27adfe9c Mon Sep 17 00:00:00 2001
    From: Sergey Tereschenko <serg.partizan@gmail.com>
    Date: Sat, 3 Jun 2017 19:17:13 +0300
    Subject: [PATCH] technical_500_response: utf-8 encoding for AJAX requests
    
    ---
     django/views/debug.py | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/django/views/debug.py b/django/views/debug.py
    index d3361486cb..5fa412d436 100644
    a b def technical_500_response(request, exc_type, exc_value, tb, status_code=500):  
    8686    reporter = ExceptionReporter(request, exc_type, exc_value, tb)
    8787    if request.is_ajax():
    8888        text = reporter.get_traceback_text()
    89         return HttpResponse(text, status=status_code, content_type='text/plain')
     89        return HttpResponse(text, status=status_code, content_type='text/plain; charset=utf-8')
    9090    else:
    9191        html = reporter.get_traceback_html()
    9292        return HttpResponse(html, status=status_code, content_type='text/html')
Back to Top