Theia is opening images as text.
The problem seems to be related to the way we have Theia integrated into a multi-user IDE. We have several instances of Theia running in Docker containers. Nginx is used to proxy connections into the correct container based on the URL.
For example, the URL might look like http://theia.mycollege.edu/ide/bbrown/cpp. Nginx extracts the user name and environment name from the URL and proxies all requests to the appropriate container. This is working correctly 99.9% of the time.
However, we are unable to view images. Depending on how I try to open the image, it either fails to load or comes out as text.
When I try to preview an image, I get an error related to the mini-browser. The URL for the image is coming out incorrectly. As an example, let’s say I have an image named burger.png in my files. When I right-click and select Open With > Preview, an error window comes up. Inspecting the Network access in the Developer Tools, I see this as the URL:
The URL is clearly incorrect: it contains what looks like a UUID and a subdomain named “mini-browser”.
If I try to open the image by simply clicking on it once, it loads as text.
Sorry for this posting being so long. I would be much appreciative if there was an easy fix for this.
Thank you!