projects
/
fwx
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix the charset
[fwx]
/
src
/
fwx
/
__init__.py
diff --git
a/src/fwx/__init__.py
b/src/fwx/__init__.py
index
d26083b
..
2cbe707
100644
(file)
--- a/
src/fwx/__init__.py
+++ b/
src/fwx/__init__.py
@@
-158,7
+158,7
@@
class Response(_Response):
'Content-Type': self.content_type,
}
'Content-Type': self.content_type,
}
- for key, value in builtin_headers:
+ for key, value in builtin_headers
.items()
:
if key in result:
raise Exception('Header "{}" defined twice'.format(key))
else:
if key in result:
raise Exception('Header "{}" defined twice'.format(key))
else:
@@
-174,7
+174,7
@@
class HTMLResponse(Response):
return super().__new__(
cls,
content,
return super().__new__(
cls,
content,
- content_type='text/html',
+ content_type='text/html
; charset=utf-8
',
**kwargs,
)
**kwargs,
)
@@
-186,7
+186,7
@@
class JSONResponse(Response):
self = super().__new__(
cls,
content=json.dumps(content_json),
self = super().__new__(
cls,
content=json.dumps(content_json),
- content_type='application/json',
+ content_type='application/json
; charset=utf-8
',
**kwargs,
)
self.content_json = content_json
**kwargs,
)
self.content_json = content_json
@@
-199,7
+199,7
@@
class TextResponse(Response):
return super().__new__(
cls,
content,
return super().__new__(
cls,
content,
- content_type='text/plain',
+ content_type='text/plain
; charset=utf-8
',
**kwargs,
)
**kwargs,
)