escape and quote the robotsTxt when templating

for now, we restrict the string length to 4096 since that is what
nginx allows
This commit is contained in:
Girish Ramakrishnan
2017-07-23 18:55:31 -07:00
parent 4fec2fe124
commit eb99f8b844
4 changed files with 10 additions and 7 deletions

View File

@@ -83,9 +83,9 @@ server {
# Disable check to allow unlimited body sizes
client_max_body_size 0;
<% if (robotsTxt) { %>
<% if (robotsTxtQuoted) { %>
location = /robots.txt {
return 200 "<%= robotsTxt %>";
return 200 <%- robotsTxtQuoted %>;
}
<% } %>