[GH-ISSUE #3565] [bug]: SVG is not rendered correctly #1222

Closed
opened 2026-03-16 19:23:02 +03:00 by kerem · 4 comments
Owner

Originally created by @kidonng on GitHub (Nov 18, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3565

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

image

ImageLens is enabled for SVG but the actual renderer doesn't handle it correctly (still treats it as a blob instead of rendering it directly)

Steps to reproduce

  1. Open Hoppscotch
  2. Send a GET request to SVG files, e.g. https://upload.wikimedia.org/wikipedia/commons/b/bd/Test.svg
  3. See broken output

Environment

Production

Version

Cloud

Originally created by @kidonng on GitHub (Nov 18, 2023). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3565 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior ![image](https://github.com/hoppscotch/hoppscotch/assets/44045911/01184086-028f-4761-bd7b-5f6ef9c77cf8) [ImageLens is enabled for SVG](https://github.com/hoppscotch/hoppscotch/blob/23afc201a12e221c01f79d731513fcfeff928fdd/packages/hoppscotch-common/src/helpers/lenses/imageLens.ts#L6-L9) but [the actual renderer](https://github.com/hoppscotch/hoppscotch/blob/23afc201a12e221c01f79d731513fcfeff928fdd/packages/hoppscotch-common/src/components/lenses/renderers/ImageLensRenderer.vue) doesn't handle it correctly (still treats it as a blob instead of rendering it directly) ### Steps to reproduce 1. Open Hoppscotch 2. Send a GET request to SVG files, e.g. https://upload.wikimedia.org/wikipedia/commons/b/bd/Test.svg 3. See broken output ### Environment Production ### Version Cloud
kerem 2026-03-16 19:23:02 +03:00
Author
Owner

@rajdip-b commented on GitHub (Nov 19, 2023):

@AndrewBastin can I give it a try?

<!-- gh-comment-id:1817840791 --> @rajdip-b commented on GitHub (Nov 19, 2023): @AndrewBastin can I give it a try?
Author
Owner

@rajdip-b commented on GitHub (Nov 19, 2023):

Hey, I went through the code and couldn't find anything that's suspicious. I feel that it's the application data of some SVG images that are impacting the dispaly.

<!-- gh-comment-id:1817922718 --> @rajdip-b commented on GitHub (Nov 19, 2023): Hey, I went through the code and couldn't find anything that's suspicious. I feel that it's the application data of some SVG images that are impacting the dispaly.
Author
Owner

@Xyndra commented on GitHub (Jan 5, 2024):

I have the same problem with manually coded SVGs. It seems like it has something to do with loading other raw image types as bytes while loading SVG as clean Text

<!-- gh-comment-id:1879336586 --> @Xyndra commented on GitHub (Jan 5, 2024): I have the same problem with manually coded SVGs. It seems like it has something to do with loading other raw image types as bytes while loading SVG as clean Text
Author
Owner

@shuaixr commented on GitHub (Oct 2, 2024):

github.com/hoppscotch/hoppscotch@e9e1366cc8/packages/hoppscotch-common/src/components/lenses/renderers/ImageLensRenderer.vue (L89-L103)

It looks like passing the type parameter when creating the blob can fix this bug. @AndrewBastin , I would like to work on this

<!-- gh-comment-id:2388041614 --> @shuaixr commented on GitHub (Oct 2, 2024): https://github.com/hoppscotch/hoppscotch/blob/e9e1366cc8a0f6d3116cb4ab5a44b964d1d36128/packages/hoppscotch-common/src/components/lenses/renderers/ImageLensRenderer.vue#L89-L103 It looks like passing the type parameter when creating the blob can fix this bug. @AndrewBastin , I would like to work on this
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1222
No description provided.