Add test for charset

This commit is contained in:
Fabrice Reix 2022-07-05 13:55:08 +02:00
parent 152105b9b8
commit 126e10537f
No known key found for this signature in database
GPG Key ID: BF5213154B2E7155
3 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1,10 @@
GET http://localhost:8000/charset/default
HTTP/1.0 200
Content-Type: text/html; charset=utf-8
```<p>Hello World!</p>```
GET http://localhost:8000/charset/uppercase
HTTP/1.0 200
Content-Type: text/html; charset=UTF-8
[Asserts]
body == "<p>Hello World!</p>"

View File

@ -0,0 +1,14 @@
from app import app
from flask import request, make_response
@app.route("/charset/default")
def charset_default():
return "<p>Hello World!</p>"
@app.route("/charset/uppercase")
def charset_uppercase():
resp = make_response("<p>Hello World!</p>")
resp.headers["Content-Type"] = "text/html; charset=UTF-8"
return resp