Skip to content

Commit 75a4891

Browse files
committed
Fix XSS in default DRF Browsable API template by re-enabling autoescape
1 parent 343ce4a commit 75a4891

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • rest_framework/templates/rest_framework

rest_framework/templates/rest_framework/base.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ <h1>{{ name }}</h1>
171171
</div>
172172

173173
<div class="response-info" aria-label="{% trans "response info" %}">
174-
<pre class="prettyprint"><span class="meta nocode"><b>HTTP {{ response.status_code }} {{ response.status_text }}</b>{% autoescape off %}{% for key, val in response_headers|items %}
174+
<pre class="prettyprint"><span class="meta nocode"><b>HTTP {{ response.status_code }} {{ response.status_text }}</b>{% for key, val in response_headers|items %}
175175
<b>{{ key }}:</b> <span class="lit">{{ val|break_long_headers|urlize_quoted_links }}</span>{% endfor %}
176176

177-
</span>{{ content|urlize_quoted_links }}</pre>{% endautoescape %}
177+
</span>{{ content|urlize_quoted_links }}</pre>
178178
</div>
179179
</div>
180180

0 commit comments

Comments
 (0)