Insomnia: Copy as Curl not respecting header case

Created on 15 Sep 2020  路  4Comments  路  Source: Kong/insomnia

When doing "Copy as Curl" on a request - the header is copied in all lower case.
E.g. I have a query with a header called "X-Application" - when doing a "Copy as Curl" it is copied as "x-application"

Desktop (please complete the following information):

  • OS: macOS 10.15.6
  • Installation Method: dmg
    Version: Insomnia Core 2020.4.0
    Release date: 10/09/2020
    OS: Darwin x64 19.6.0
    Electron: 9.1.1
    Node: 12.14.1
    V8: 8.3.110.13-electron.0
    Architecture: x64
    node-libcurl: libcurl/7.69.1 OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.7 libidn2/2.1.1 libssh2/1.9.0 nghttp2/1.41.0
bug good first issue

Most helpful comment

I can confirm that we are loosing case during snippet conversion. It seems related to https://github.com/Kong/httpsnippet/issues/74 馃

All 4 comments

For anybody venturing into this issue and would like to pick it up, here is the generation logic 馃槃 Losing case may either be happening during exportHarRequest, or during HTTPSnippet convert.

https://github.com/Kong/insomnia/blob/51d3a5de32043dcf429f66afab955e66b6ac7e76/packages/insomnia-app/app/ui/containers/app.js#L466-L473

I can confirm that we are loosing case during snippet conversion. It seems related to https://github.com/Kong/httpsnippet/issues/74 馃

https://github.com/Kong/httpsnippet/pull/178 has been merged, which resolves the linked issue - thanks @jgiovaresco! Once a new version of httpsnippet is released, it will just be a matter of updating Insomnia to consume that new version.

1.23.0 for httpsnippet has been released: https://github.com/Kong/httpsnippet/releases/tag/1.23.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

claratorres picture claratorres  路  3Comments

Fyb3roptik picture Fyb3roptik  路  4Comments

tmaiaroto picture tmaiaroto  路  4Comments

artoodeeto picture artoodeeto  路  4Comments

misterpickypants picture misterpickypants  路  3Comments