From 4121b01b912668c049b26194a9a107c27a332429 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 30 Sep 2020 09:15:46 +0100 Subject: [PATCH] Deprecate urlize_quoted_links in favor of Django's built-in urlize --- rest_framework/__init__.py | 2 +- rest_framework/renderers.py | 2 +- rest_framework/templates/rest_framework/base.html | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rest_framework/__init__.py b/rest_framework/__init__.py index 29c53dd7ed..471b5db196 100644 --- a/rest_framework/__init__.py +++ b/rest_framework/__init__.py @@ -8,7 +8,7 @@ """ __title__ = 'Django REST framework' -__version__ = '3.11.1' +__version__ = '3.11.2' __author__ = 'Tom Christie' __license__ = 'BSD 3-Clause' __copyright__ = 'Copyright 2011-2019 Encode OSS Ltd' diff --git a/rest_framework/renderers.py b/rest_framework/renderers.py index 29ac90ea8e..017ebbc6da 100644 --- a/rest_framework/renderers.py +++ b/rest_framework/renderers.py @@ -418,7 +418,7 @@ def get_content(self, renderer, data, if render_style == 'binary': return '[%d bytes of binary content]' % len(content) - return content + return content.decode('utf-8') if isinstance(content, bytes) else content def show_form_for_method(self, view, method, request, obj): """ diff --git a/rest_framework/templates/rest_framework/base.html b/rest_framework/templates/rest_framework/base.html index 5d9d80b057..0fac705a2d 100644 --- a/rest_framework/templates/rest_framework/base.html +++ b/rest_framework/templates/rest_framework/base.html @@ -77,7 +77,7 @@
{% block request_forms %} - + {% if 'GET' in allowed_methods %}
@@ -176,9 +176,9 @@

{{ name }}

HTTP {{ response.status_code }} {{ response.status_text }}{% for key, val in response_headers|items %}
-{{ key }}: {{ val|break_long_headers|urlize_quoted_links }}{% endfor %}
+{{ key }}: {{ val|break_long_headers|urlize }}{% endfor %}
 
-{{ content|urlize_quoted_links }}
+{{ content|urlize }}
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy