The scenario is the following:
For a single component we're getting the html content from an external provider. Including images. For each image we have to call a separate endpoint of the external provider. In return we get the Binary data with the http header "content-type:image/jpeg.
So basically I have this link
<img src="mydomain.com/-/city/images/test.jpg" />
But this image does not exist and never will be in Sitecore. Instead for every image that starts with "-/city" I need to get the image from somewhere else. My Idea was to overwrite the MediaProvider where I set the Url to an existing Media Item. Once that is assigned I want to call the endpoint and return the mediastream from my endpoint. I've followed this blog post: https://sitecorejumpstart.wordpress.com/2020/02/28/override-the-sitecore-media-provider/
But already failed here:
public override MediaRequest ParseMediaRequest(HttpRequest request)
as I cannot change the called Url to something else in the request.
Any idea how or if this is doable at all? I'm using SC 9.1.1 btw with SxA