Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import curl doesn't work well #1557

Open
noam-honig opened this issue Jun 11, 2024 · 3 comments
Open

Import curl doesn't work well #1557

noam-honig opened this issue Jun 11, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@noam-honig
Copy link

noam-honig commented Jun 11, 2024

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:

  • OS: Windows 11
  • vscode version: 1.90
  • node version: 20.14
  • extension version: 2.24.11

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

@noam-honig noam-honig added the bug Something isn't working label Jun 11, 2024
@noam-honig
Copy link
Author

@rangav any updates on this?

@rangav
Copy link
Collaborator

rangav commented Aug 30, 2024

@noam-honig I imported the above cURL its working for me.

Not executing the request is a different issue.

@noam-honig
Copy link
Author

Hi @rangav thanks for getting back to me - I've tested this on a few windows 10 /11 machines.
In all - the first time I request to import this curl it fails - it only imports it the second time.
Also - in all I need to change the address from localhost to [::1] to get it to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants