[GH-ISSUE #4253] [bug]: Square brackets are not escaped in Curl generated code #1537

Open
opened 2026-03-16 20:45:47 +03:00 by kerem · 1 comment
Owner

Originally created by @Macek007 on GitHub (Aug 12, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4253

Is there an existing issue for this?

  • 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

Originally created by @Macek007 on GitHub (Aug 12, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4253 ### 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
Author
Owner

@markwaterbury commented on GitHub (Apr 8, 2025):

I am not seeing any URL encoding happening for query parameters, so I think this applies to more than just square brackets.

<!-- gh-comment-id:2787549883 --> @markwaterbury commented on GitHub (Apr 8, 2025): I am not seeing any URL encoding happening for query parameters, so I think this applies to more than just square brackets.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1537
No description provided.