bobjflong / yesod-csp

add CSP headers to Yesod apps
MIT License
8 stars 4 forks source link

Parse error when there're newlines in quotes #6

Closed pythonissam closed 5 years ago

pythonissam commented 6 years ago

Can we write like this:

cspPolicy [csp|
  default-src 'self';
  script-src 'self' $nonce-rndVal https://cdnjs.cloudflare.com https://use.fontawesome.com https://code.jquery.com;
  style-src 'self' https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://code.jquery.com;
  img-src 'self' data:
|]

instead of:

cspPolicy [csp|default-src 'self';
      script-src 'self' $nonce-rndVal https://cdnjs.cloudflare.com https://use.fontawesome.com https://code.jquery.com;
      style-src 'self' https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://code.jquery.com;
      img-src 'self' data:|]
bobjflong commented 5 years ago

Hey @pythonissam - I will take a look at this as soon as I can. Just to clarify - are you saying that the second example successfully compiles, but the first does not?

pythonissam commented 5 years ago

Yes, exactly.

bobjflong commented 5 years ago

Sorry for the extreme delay here. I believe this is fixed in 2.5.0 which I just pushed to hackage.