Huachao / vscode-restclient

REST Client Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=humao.rest-client
MIT License
5.32k stars 445 forks source link

When response body is not a JSON valid and response content type is JSON fails with Unexpected token s in JSON at position 0 #1221

Open jabaruben opened 1 year ago

jabaruben commented 1 year ago

Steps to Reproduce:

  1. Create a request as you want
  2. Make that the response have content-type application json and the body have var_dump("sdfasd");exit;
  3. Make the request
  4. No panel opens and VSCode show you a warning on bottom right corner that sais: Unexpected token s in JSON at position 0
  5. If you try to make a new request (changing the response body to a valid JSON response) this new request obtains the same result as previous. Like the extension is corrupted (if you see the developers console, you can see a js error)
  6. Need to restart VSCode to make the extension works.