-
Notifications
You must be signed in to change notification settings - Fork 240
Description
For example, I'm pretty sure this is an entirely valid raw HTTP header:
My-Header: "quoted" 'value'
In almost all cases I've seen, httpsnippet inserts this header value literally, without escaping either quote format, but within quotes in the output syntax, and so generating broken output every time, like: headers: { "My-Header": ""quoted" 'value'" }
This is bad because quotes are used in a lot of real HTTP traffic, for example new Chromium versions now send a "sec-ch-ua-platform" header on every single HTTPS request, and the value is always wrapped in quotes: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Platform.
That means this breaks almost all snippets from almost all Chrome HAR files, making them all syntactically invalid.
The only cases I've seen where this does work is the JS snippets that use stringify-object to build an options object, which generates single-quoted output and automatically escapes any included string quotes en route.