Response preview adds whitespace to URL
Tolsto opened this issue · comments
Expected Behavior
The preview should not add a whitespace in the middle of the URL.
Actual Behavior
![image](https://private-user-images.githubusercontent.com/20240901/320025408-d05d3f9d-fe06-4cf2-bb61-c493d1950284.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgzNDM2MDgsIm5iZiI6MTcxODM0MzMwOCwicGF0aCI6Ii8yMDI0MDkwMS8zMjAwMjU0MDgtZDA1ZDNmOWQtZmUwNi00Y2YyLWJiNjEtYzQ5M2QxOTUwMjg0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE0VDA1MzUwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdhMGU1YzlhMGU4YWYyM2ZhNDc4MTEwNmU0ZDY4Mzg4MGE4NWU5NDQ3ZDA0YWQxYjI4YWRjNjJhMGRkMWQ3MDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.fSSIjBDSCvJzMUpQxp8zPqy3GctMaCbLAcbjcTwq0HI)
![image](https://private-user-images.githubusercontent.com/20240901/320025488-0a87ed08-81d9-430b-90e9-e05ffc7c7222.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgzNDM2MDgsIm5iZiI6MTcxODM0MzMwOCwicGF0aCI6Ii8yMDI0MDkwMS8zMjAwMjU0ODgtMGE4N2VkMDgtODFkOS00MzBiLTkwZTktZTA1ZmZjN2M3MjIyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE0VDA1MzUwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUyZDdkZDg3NTQ2NTNjN2MzZjc3ODM1MDQzMjFlZDIzZDg2NDVkNjAwMjAwNjZiMDcwOGQ4ZDI2MWNiYTJlMDYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.OY7EBE1uU2Mn7OJMHRGoP7fcphJXoNmPzElZXgogI-g)
Reproduction Steps
No response
Is there an existing issue for this?
- I have searched the issue tracker for this problem.
Additional Information
No response
Insomnia Version
9.0.0-beta.3
What operating system are you using?
macOS
Operating System Version
14.4.1 (23E224)
Installation method
dmg
Last Known Working Insomnia version
No response
Able to reproduce this bug. Specifically, seems to happen when both of the following conditions are met:
- Response contains a JSON key value enclosed in single quotes rather than double quotes
- Value that is enclosed in the aforementioned single quotes contains a colon
Not sure why this happens.
Worth noting, single quotes for JSON keys and values is technically invalid syntax (although some popular JSON formatters are lenient on this). This is still a valid bug though of course.
Hm, didn't even notice the single quotes. That's actually the default serialization of AWS Lambda, at least when running locally with SAM CLI.
Appears to be caused by this line. In the prettify function taken from json-lint.
- pull a newer copy of this code from json-lint
- add a test and fix it inline
- use
prettier
or some other formatter than can accept single quoted objects
That's actually the default serialization of AWS Lambda
Single quotes is not a valid JSON value, this is a problem with AWS.