I have a Spring Boot application which should act like a proxy.
It should process requests like "http://imageservice/picture/123456"
Then the application should generate a new request to "http://internal-picture-db/123456.jpg" where it should download the picture behind it (123456.jpg) and then pass it to the response and serve it.
It should be like...
@RequestMapping("/picture/{id}")
public String getArticleImage(@PathVariable String id, HttpServletResponse response) {
logger.info("Requested picture >> " + id + " <<");
// 1. download img from http://internal-picture-db/id.jpg ...
// 2. send img to response... ?!
response.???
}
I hope it's clear what I mean...
So my question is: What is the best way to do so?
And just for information it is not possible to just send a redirect because the system is not available in the internet.