netlify / netlify-playground

https://play.netlify.com
MIT License
89 stars 16 forks source link

Double quotation marks are not correctly backslashed in the dumped toml file #34

Open eternal-flame-AD opened 5 years ago

eternal-flame-AD commented 5 years ago

- Do you want to request a feature or report a bug?

Bug.

- What is the current behavior?

Double quotation marks are not correctly backslashed in the dumped toml file

- If the current behavior is a bug, please provide the steps to reproduce.

Dump the following _headers file, which is valid and the double quotation marks would appear on the actual header

/*
    Public-Key-Pins-Report-Only: pin-sha256="[redacted]"; pin-sha256="[redacted]"; max-age=8640000; report-uri="[redacted]"

I got the following result

[[headers]]
for = "/*"
[headers.values]
Public-Key-Pins-Report-Only = "pin-sha256="[redacted]"; pin-sha256="[redacted]"; max-age=8640000; report-uri="[redacted]""

- What is the expected behavior?

The double quotation should be correctly escaped according to the toml specification, e.g.:

[[headers]]
for = "/*"
[headers.values]
Public-Key-Pins-Report-Only = "pin-sha256=\"[redacted]\"; pin-sha256=\"[redacted]\"; max-age=8640000; report-uri=\"[redacted]\""
UdokaVrede commented 3 years ago

Hi can I take up this issues?