Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #8287: the debug page now shows the actual requested URL even i…

…f you've messed with request.path. Patch from Giuliani Vito Ivan.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8633 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 887f778794d23968b9060e35d11065577e12cebe 1 parent 2e9a880
Jacob Kaplan-Moss authored August 27, 2008

Showing 1 changed file with 9 additions and 9 deletions. Show diff stats Hide diff stats

  1. 18  django/views/debug.py
18  django/views/debug.py
@@ -254,7 +254,7 @@ def technical_404_response(request, exception):
254 254
     t = Template(TECHNICAL_404_TEMPLATE, name='Technical 404 template')
255 255
     c = Context({
256 256
         'root_urlconf': settings.ROOT_URLCONF,
257  
-        'request_path': request.path[1:], # Trim leading slash
  257
+        'request_path': request.path_info[1:], # Trim leading slash
258 258
         'urlpatterns': tried,
259 259
         'reason': smart_str(exception, errors='replace'),
260 260
         'request': request,
@@ -282,7 +282,7 @@ def empty_urlconf(request):
282 282
 <head>
283 283
   <meta http-equiv="content-type" content="text/html; charset=utf-8">
284 284
   <meta name="robots" content="NONE,NOARCHIVE">
285  
-  <title>{{ exception_type }} at {{ request.path|escape }}</title>
  285
+  <title>{{ exception_type }} at {{ request.path_info|escape }}</title>
286 286
   <style type="text/css">
287 287
     html * { padding:0; margin:0; }
288 288
     body * { padding:10px 20px; }
@@ -388,7 +388,7 @@ def empty_urlconf(request):
388 388
 </head>
389 389
 <body>
390 390
 <div id="summary">
391  
-  <h1>{{ exception_type }} at {{ request.path|escape }}</h1>
  391
+  <h1>{{ exception_type }} at {{ request.path_info|escape }}</h1>
392 392
   <pre class="exception_value">{{ exception_value|escape }}</pre>
393 393
   <table class="meta">
394 394
     <tr>
@@ -397,7 +397,7 @@ def empty_urlconf(request):
397 397
     </tr>
398 398
     <tr>
399 399
       <th>Request URL:</th>
400  
-      <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path|escape }}</td>
  400
+      <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path_info|escape }}</td>
401 401
     </tr>
402 402
     <tr>
403 403
       <th>Exception Type:</th>
@@ -520,14 +520,14 @@ def empty_urlconf(request):
520 520
   <form action="http://dpaste.com/" name="pasteform" id="pasteform" method="post">
521 521
   <div id="pastebinTraceback" class="pastebin">
522 522
     <input type="hidden" name="language" value="PythonConsole">
523  
-    <input type="hidden" name="title" value="{{ exception_type|escape }} at {{ request.path|escape }}">
  523
+    <input type="hidden" name="title" value="{{ exception_type|escape }} at {{ request.path_info|escape }}">
524 524
     <input type="hidden" name="source" value="Django Dpaste Agent">
525 525
     <input type="hidden" name="poster" value="Django">
526 526
     <textarea name="content" id="traceback_area" cols="140" rows="25">
527 527
 Environment:
528 528
 
529 529
 Request Method: {{ request.META.REQUEST_METHOD }}
530  
-Request URL: {{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path|escape }}
  530
+Request URL: {{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path_info|escape }}
531 531
 Django Version: {{ django_version_info }}
532 532
 Python Version: {{ sys_version_info }}
533 533
 Installed Applications:
@@ -554,7 +554,7 @@ def empty_urlconf(request):
554 554
 {% for frame in frames %}File "{{ frame.filename|escape }}" in {{ frame.function|escape }}
555 555
 {% if frame.context_line %}  {{ frame.lineno }}. {{ frame.context_line|escape }}{% endif %}
556 556
 {% endfor %}
557  
-Exception Type: {{ exception_type|escape }} at {{ request.path|escape }}
  557
+Exception Type: {{ exception_type|escape }} at {{ request.path_info|escape }}
558 558
 Exception Value: {{ exception_value|escape }}
559 559
 </textarea>
560 560
   <br><br>
@@ -687,7 +687,7 @@ def empty_urlconf(request):
687 687
 <html lang="en">
688 688
 <head>
689 689
   <meta http-equiv="content-type" content="text/html; charset=utf-8">
690  
-  <title>Page not found at {{ request.path|escape }}</title>
  690
+  <title>Page not found at {{ request.path_info|escape }}</title>
691 691
   <meta name="robots" content="NONE,NOARCHIVE">
692 692
   <style type="text/css">
693 693
     html * { padding:0; margin:0; }
@@ -717,7 +717,7 @@ def empty_urlconf(request):
717 717
       </tr>
718 718
       <tr>
719 719
         <th>Request URL:</th>
720  
-      <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path|escape }}</td>
  720
+      <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path_info|escape }}</td>
721 721
       </tr>
722 722
     </table>
723 723
   </div>

0 notes on commit 887f778

Please sign in to comment.
Something went wrong with that request. Please try again.