hoppscotch-extension icon indicating copy to clipboard operation
hoppscotch-extension copied to clipboard

Invalid json, trailing null chars added

Open utix opened this issue 5 years ago • 8 comments

Looks like the answered response is corrupted

The raw data downloaded from https://hoppscotch.io/ has two null character at this end. image

I have checked with wireshark, there is no issue the data is correct and there is not trailing null chars image

I suspect to plugin to have added it, how can I check it ?

utix avatar Sep 07 '20 09:09 utix

It has added it, there is a setting which removes the extension and the trailing null is removed

exussum12 avatar Sep 17 '20 07:09 exussum12

This is a known issue while using browser extension. We're working on a fix. Kindly stay tuned. Temporarily, you can try turning off extension from Settings > Extensions.

liyasthomas avatar Sep 17 '20 08:09 liyasthomas

While a better fix is being worked on is it worth just adding .replace(/\0$/, '') to remove the null byte ?

exussum12 avatar Sep 17 '20 12:09 exussum12

@AndrewBastin

liyasthomas avatar Sep 17 '20 12:09 liyasthomas

Well, I did a patch in Hoppscotch for just removing the null byte, but i will get around fixing that soon.

Keeping this issue open until then.

AndrewBastin avatar Oct 02 '20 19:10 AndrewBastin

The same issue is also true for image/svg+xml. The issue is pretty old, is there any progress, or is the extension abandoned?

timogriese avatar May 19 '23 14:05 timogriese

@timogriese The extension is not abandoned and is still actively supported, there wasn't much work on it is why there aren't any updates.

We had a patch long back on hoppscotch app itself to trim the trailing null.

If you are able to reproduce, can I get like an endpoint or something I can test on ?

AndrewBastin avatar May 19 '23 14:05 AndrewBastin

@AndrewBastin Thank you for your quick feedback. Here is an endpoint for debugging the issue. https://bygdrvuqslgkfdiatvkf.functions.supabase.co/hoppscotch-debug/generate/pattern I made it listen on GET, so you can easily test it with your browser. Edge yields this message when I used Hoppscotch + the browser-extension to download the svg. image Everything works well if I directly GET the endpoint without the browser-extension (using Proxy) or the browser. image To make the issue more clear, here is a screenshot of the trailing null values in the SVG: image

timogriese avatar May 19 '23 15:05 timogriese