thunderclient / thunder-client-support

Thunder Client is a lightweight Rest API Client Extension for VS Code.
https://www.thunderclient.com
Other
3.59k stars 128 forks source link

Import curl doesn't work well #1557

Open noam-honig opened 1 month ago

noam-honig commented 1 month ago

Describe the bug Love this tool.

I use import curl a lot - and it misbehaves, consider the following curl:

curl 'http://localhost:3000/' \
  -H 'Accept: text/x-component' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: text/plain;charset=UTF-8' \
  -H 'Cookie: next-auth.csrf-token=6e6d1031692e7d21620ef917224953d5460d589aac1eb0304ce66d59585b9b86%7Cab4d2b3c386b4b1d4377d8411a85fbad1ed12417ffe70f199699393efc120dbb; next-auth.callback-url=http%3A%2F%2Flocalhost%3A3000%2F; next-auth.session-token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..TPMVxKsM2PJurq_w.-8XWj2084mthXAqR9p7GKGo61fWuxNTpJGKVq1EUYJXDQ_nT9EyhkMZU3NCv2VjDvPvCGAiw9GLl2NoKAumN3dvjnmTLoIgCqELdsMb_e6JEB0tdEVkTG2K12MOPXA0iUCDshZE2k3uVhXw.TeEL1hVpExaN1QS_dmx3TA' \
  -H 'Next-Action: 03702d592dabc244293460974fbc8a99a09f71e8' \
  -H 'Next-Router-State-Tree: %5B%22%22%2C%7B%22children%22%3A%5B%22__PAGE__%22%2C%7B%7D%2C%22%2F%22%2C%22refresh%22%5D%7D%2Cnull%2Cnull%2Ctrue%5D' \
  -H 'Origin: http://localhost:3000' \
  -H 'Referer: http://localhost:3000/' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' \
  -H 'sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  --data-raw '[{"title":"123"}]'
  1. First time I import it I get an error "Failed to import cUrl"
  2. Second time I import it it imports but when I run it I get "Invalid IP address: undefined"
  3. When I change "localhost" to 127.0.0.1 it calls (but then my server - nextjs doesn't like the url change :))

Platform:

Are you using the free version/paid version/trial: Free version