Pass REST API icon request through my own server

I am facing issue while developing fix for bug that caused the icons were not displaying at client side.
In our plugin we place request type icon near request type name. Some client reported issue that icons are not displaying at all on few browsers (because cookies are not passed to further request → err code 401).
So we decided to pass request for these icons through our server. I’m using REST API path:


But when I pass response from that route as ResponseEntity<String> to our controller, I’m not able to display img as when I access for example:

Does anybody know how to do it?

Additionally I’ve noticed that route is responding with Contenty-Type image/png;charset:UTF-8, why is that? When I tried to parse response from UTF-8 to Base64 and then to image, it was corrupted.

Ok, I solved this problem. You need just to switch ResponseEntity<String> to ResponseEntity<byte[]>.

1 Like