forked from orbit-oss/flask
Fixed a security problem caused by changed simplejson semantics.
Notice: this was never in a release version of Flask.
This commit is contained in:
parent
07e515b071
commit
ade490514d
4 changed files with 16 additions and 2 deletions
|
|
@ -194,6 +194,12 @@ class JSONTestCase(unittest.TestCase):
|
|||
content_type='application/json')
|
||||
assert rv.data == '3'
|
||||
|
||||
def test_template_escaping(self):
|
||||
app = flask.Flask(__name__)
|
||||
with app.test_request_context():
|
||||
rv = flask.render_template_string('{{ "</script>"|tojson|safe }}')
|
||||
assert rv == '"<\\/script>"'
|
||||
|
||||
|
||||
class TemplatingTestCase(unittest.TestCase):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue