8000 Return full text response · flask-api/flask-api@68ac576 · GitHub
[go: up one dir, main page]

Skip to content

Commit 68ac576

Browse files
committed
Return full text response
1 parent b39b4ef commit 68ac576

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

flask_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from flask_api.app import FlaskAPI
22

3-
__version__ = '0.7b1'
3+
__version__ = '0.7b2'

flask_api/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf8
22
from __future__ import unicode_literals
33
from flask import request, Flask, Blueprint
4-
from flask._compat import reraise, string_types
4+
from flask._compat import reraise, string_types, text_type
55
from flask_api.exceptions import APIException
66
from flask_api.request import APIRequest
77
from flask_api.response import APIResponse
@@ -55,7 +55,7 @@ def make_response(self, rv):
5555
headers, status_or_headers = status_or_headers, None
5656

5757
if not isinstance(rv, self.response_class):
58-
if isinstance(rv, (bytes, bytearray, list, dict)):
58+
if isinstance(rv, (text_type, bytes, bytearray, list, dict)):
5959
rv = self.response_class(rv, headers=headers, status=status_or_headers)
6060
headers = status_or_headers = None
6161
else:

flask_api/response.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# coding: utf8
22
from __future__ import unicode_literals
33
from flask import request, Response
4+
from flask._compat import text_type
45

56

67
class APIResponse(Response):
@@ -20,7 +21,7 @@ def __init__(self, content=None, *args, **kwargs):
2021
# From `werkzeug.wrappers.BaseResponse`
2122
if content is None:
2223
content = []
23-
if isinstance(content, (bytes, bytearray)):
24+
if isinstance(content, (text_type, bytes, bytearray)):
2425
self.set_data(content)
2526
else:
2627
self.response = content

0 commit comments

Comments
 (0)
0