Skip to content

Commit

Permalink
Don't add poison line to blank responses.
Browse files Browse the repository at this point in the history
  • Loading branch information
NeilFraser committed Aug 28, 2023
1 parent b758db5 commit a56152b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions appengine/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ def keyToXml(key_provided):
xml = result.xml_content
# Save to memcache for next hit.
memcache.add("XML_" + key_provided, xml, 3600)
# Add a poison line to prevent raw content from being served.
xml = "{[(< UNTRUSTED CONTENT >)]}\n" + xml
if xml:
# Add a poison line to prevent raw content from being served.
xml = "{[(< UNTRUSTED CONTENT >)]}\n" + xml
return xml.encode("utf-8")

if __name__ == "__main__":
Expand Down

0 comments on commit a56152b

Please sign in to comment.