mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #32087 -- Made technical 500 debug page use HTTPS for sharing traceback.
This commit is contained in:
		
				
					committed by
					
						
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						parent
						
							f1f24539d8
						
					
				
				
					commit
					079deba530
				
			@@ -278,7 +278,7 @@
 | 
			
		||||
      {% endfor %}
 | 
			
		||||
    </ul>
 | 
			
		||||
  </div>
 | 
			
		||||
  <form action="http://dpaste.com/" name="pasteform" id="pasteform" method="post">
 | 
			
		||||
  <form action="https://dpaste.com/" name="pasteform" id="pasteform" method="post">
 | 
			
		||||
{% if not is_email %}
 | 
			
		||||
  <div id="pastebinTraceback" class="pastebin">
 | 
			
		||||
    <input type="hidden" name="language" value="PythonConsole">
 | 
			
		||||
 
 | 
			
		||||
@@ -401,6 +401,19 @@ class ExceptionReporterTests(SimpleTestCase):
 | 
			
		||||
        self.assertIn('<h2>Request information</h2>', html)
 | 
			
		||||
        self.assertIn('<p>Request data not supplied</p>', html)
 | 
			
		||||
 | 
			
		||||
    def test_sharing_traceback(self):
 | 
			
		||||
        try:
 | 
			
		||||
            raise ValueError('Oops')
 | 
			
		||||
        except ValueError:
 | 
			
		||||
            exc_type, exc_value, tb = sys.exc_info()
 | 
			
		||||
        reporter = ExceptionReporter(None, exc_type, exc_value, tb)
 | 
			
		||||
        html = reporter.get_traceback_html()
 | 
			
		||||
        self.assertIn(
 | 
			
		||||
            '<form action="https://dpaste.com/" name="pasteform" '
 | 
			
		||||
            'id="pasteform" method="post">',
 | 
			
		||||
            html,
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    def test_eol_support(self):
 | 
			
		||||
        """The ExceptionReporter supports Unix, Windows and Macintosh EOL markers"""
 | 
			
		||||
        LINES = ['print %d' % i for i in range(1, 6)]
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user