Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

config.conf.j2 also replaces ';' inside quotes #135

Closed
pieterlexis opened this issue Nov 17, 2016 · 2 comments
Closed

config.conf.j2 also replaces ';' inside quotes #135

pieterlexis opened this issue Nov 17, 2016 · 2 comments

Comments

@pieterlexis
Copy link
Contributor

Consider the following (abbreviated for clarity):

nginx_configs:
  ssl:
    - 'add_header Strict-Transport-Security "max-age=63072000; preload"'

This is rendered as follows in ssl.conf:

add_header Strict-Transport-Security "max-age=63072000;
preload";

The header is indeed sent like that:

lieter $ curl -I $MYHOST
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 17 Nov 2016 10:53:43 GMT
Content-Type: text/plain
Content-Length: 2213
Last-Modified: Thu, 17 Nov 2016 10:15:50 GMT
Connection: keep-alive
ETag: "582d8356-8a5"
Strict-Transport-Security: max-age=63072000;
preload
Accept-Ranges: bytes

Browsers will ignore the preload (which is bad in itself), but I used this config in front of a Debian repository, and apt throws an error about this, rendering the repo useless.

Might I suggest that the replacements in config.conf.j2 are made smarter, so they don't add a \n when there is a ';' inside quotes?

@jdauphant
Copy link
Owner

Hello, A new was introduced to compensate that:
https://github.com/jdauphant/ansible-role-nginx/releases/tag/v1.2

@pieterlexis
Copy link
Contributor Author

This will work perfectly, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants