Add ability for specific backends to enable template escaping. Closes #441.
This commit is contained in:
parent
73452c79f7
commit
d3e4c2c4b5
6 changed files with 27 additions and 6 deletions
|
|
@ -66,3 +66,7 @@ class EC2Response(
|
|||
def ec2_backend(self):
|
||||
from moto.ec2.models import ec2_backends
|
||||
return ec2_backends[self.region]
|
||||
|
||||
@property
|
||||
def should_autoescape(self):
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from xml.sax.saxutils import escape
|
||||
from moto.core.responses import BaseResponse
|
||||
from moto.ec2.models import validate_resource_ids
|
||||
from moto.ec2.utils import sequence_from_querystring, tags_from_query_string, filters_from_querystring
|
||||
|
|
@ -26,8 +25,6 @@ class TagResponse(BaseResponse):
|
|||
def describe_tags(self):
|
||||
filters = filters_from_querystring(querystring_dict=self.querystring)
|
||||
tags = self.ec2_backend.describe_tags(filters=filters)
|
||||
for tag in tags:
|
||||
tag['value'] = escape(tag['value'])
|
||||
template = self.response_template(DESCRIBE_RESPONSE)
|
||||
return template.render(tags=tags)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue