Skip to content

Commit 4121b01

Browse files
committed
Deprecate urlize_quoted_links in favor of Django's built-in urlize
1 parent f3d9d68 commit 4121b01

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

rest_framework/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"""
99

1010
__title__ = 'Django REST framework'
11-
__version__ = '3.11.1'
11+
__version__ = '3.11.2'
1212
__author__ = 'Tom Christie'
1313
__license__ = 'BSD 3-Clause'
1414
__copyright__ = 'Copyright 2011-2019 Encode OSS Ltd'

rest_framework/renderers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def get_content(self, renderer, data,
418418
if render_style == 'binary':
419419
return '[%d bytes of binary content]' % len(content)
420420

421-
return content
421+
return content.decode('utf-8') if isinstance(content, bytes) else content
422422

423423
def show_form_for_method(self, view, method, request, obj):
424424
"""

rest_framework/templates/rest_framework/base.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777

7878
<div class="region" aria-label="{% trans "request form" %}">
7979
{% block request_forms %}
80-
80+
8181
{% if 'GET' in allowed_methods %}
8282
<form id="get-form" class="pull-right">
8383
<fieldset>
@@ -176,9 +176,9 @@ <h1>{{ name }}</h1>
176176

177177
<div class="response-info" aria-label="{% trans "response info" %}">
178178
<pre class="prettyprint"><span class="meta nocode"><b>HTTP {{ response.status_code }} {{ response.status_text }}</b>{% for key, val in response_headers|items %}
179-
<b>{{ key }}:</b> <span class="lit">{{ val|break_long_headers|urlize_quoted_links }}</span>{% endfor %}
179+
<b>{{ key }}:</b> <span class="lit">{{ val|break_long_headers|urlize }}</span>{% endfor %}
180180

181-
</span>{{ content|urlize_quoted_links }}</pre>
181+
</span>{{ content|urlize }}</pre>
182182
</div>
183183
</div>
184184

0 commit comments

Comments
 (0)