ducaale / xh

Friendly and fast tool for sending HTTP requests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xh doesn't translate `[` and `]` to curl correctly.

barkoder opened this issue · comments

xh --curl https://example.com/[something]

gives

curl 'https://example.com/[something]'

which doesn't work.

[ and ] will need to be percent encoded to %5B and %5D respectively or they need to be escaped.

This works - curl 'https://example.com/%5Bsomething%5D'

As does this - curl 'https://example.com/\[something\]'

Could you fix this ?

Thanks!

Another option is to disable URL globbing if we detect any of cURL's reserved URL symbols i.e [, ], {, or }

$ xh --curl https://example.com/[something]
curl -g 'https://example.com/[something]'