hoppscotch icon indicating copy to clipboard operation
hoppscotch copied to clipboard

[bug]: Square brackets are not escaped in Curl generated code

Open Macek007 opened this issue 6 months ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current behavior

When i use square brackets [] in GET parameters, e.g.

https://localhost:5034/api/admin/translations?trash=0&page[size]=2&filter[inDomain]=admin_client&sort[0][field]=id&sort[0][order]=asc

it should be escaped in generated in Curl code like this

 curl --request GET \
  --url 'https://localhost:5034/api/admin/translations?trash=0&page%5Bsize%5D=2&filter%5BinDomain%5D=admin_client&sort%5B0%5D%5Bfield%5D=id&sort%5B0%5D%5Border%5D=asc'      

Steps to reproduce

I any GET request

  • use parametr with square brackets eg. filter[id]
  • Click "show code" on Send button and choose Sell Curl

Environment

Production

Version

Self-hosted

Macek007 avatar Aug 12 '24 15:08 Macek007