cartero icon indicating copy to clipboard operation
cartero copied to clipboard

Handle image/* content types

Open sequencerr opened this issue 11 months ago • 5 comments

https://apod.nasa.gov/apod/image/2501/HubblesVariablecopy1024.jpg you just wait 10s and see empty body. with texteara, but it's an attachment. maybe preview media at the end of download, or update preview with each chunk?

sequencerr avatar Feb 01 '25 01:02 sequencerr

It's currently not designed to handle the content type image/jpeg, but this is clearly a missing feature.

danirod avatar Feb 02 '25 11:02 danirod

Missing this feature as well. Just being able to save response body content as a file, instead of it showing it as binary text, would already be good enough for me (and if you want to show content text, please don't load all binary data as text if it is a big image)!

sverro2 avatar Mar 25 '25 16:03 sverro2

Well any big chunk of data (e.g. above 1mb) should be truncated like in firefox devtools to not crash the textfield

sequencerr avatar Mar 25 '25 17:03 sequencerr

Possibly related: export responses, based on a prior conversation held in the Discussions section. These would be two separate things, which also makes more probable to at least advance any of them:

  • Displaying images in the program. Supposedly there are facilities in the framework to do that.
  • Export the response contents, or the entire response object as HAR. This would benefit not just images but also any kind of response.

And of course, as a follow up, once there is a way to download files, any unrecognized content type that is not designed to be treated as text (application/pdf, application/octet-stream, audio/, video/) should not be rendered at all. Can show in the panel a message like "Binary content (24.1 kB)" and another button to trigger the "Export response" action.

danirod avatar Mar 26 '25 11:03 danirod

I've added support for exporting responses in #247, and a new panel that prevent rendering binary payloads into the response panel in #249:

Image

Rendering images will still not be possible right now, because I don't trust the platform enough to render remote images that may have surprises inside (zero-days and that stuff). This is not a final decision and I might eventually add support for rendering images, though.

danirod avatar Aug 08 '25 18:08 danirod