Open jeanp413 opened 2 years ago
I've replaced the fileType detection logic with Apache Tika. It supports more file types out of the box and it lets you configure custom file types too.
The bad news is that the getFileType
method is also used when uploading a file to cloud storage:
https://github.com/eclipse/openvsx/blob/72706d126e642d6d714c5ae40bc970dd35340986/server/src/main/java/org/eclipse/openvsx/storage/GoogleCloudStorageService.java#L71-L72
https://github.com/eclipse/openvsx/blob/72706d126e642d6d714c5ae40bc970dd35340986/server/src/main/java/org/eclipse/openvsx/storage/AzureBlobStorageService.java#L72-L73
This means that all files that currently are incorrectly of type text/plain
and all vsix packages (type should be application/vsix
instead of application/octet-stream
) need to be downloaded and re-uploaded with the correct Content-Type
.
Luckily the release that is not running in production yet uses JobRunr to perform a long running migration in the background. The same technique can be used to re-upload files with the right Content-Type
.
text/plain
filesThis only matters for web extension (__web_extension
tag) and I guess there're not many of those :crossed_fingers:, do you have some numbers about the number of web extension?
Ok, that would narrow it down. I don't know how many of the extensions are web extensions.
text/plain
files@amvanbaren Just making sure I'm following the discussion. This is not a change we're asking extension authors to make, but rather a batch process to 're-publish' extensions to have the file types registered correctly?
Yes, it's a migration that reprocesses extensions to have the file types registered correctly.
From https://github.com/gitpod-io/gitpod/issues/10523
It seems the root cause of that bug is that Web extension resources served from openvsx return an incorrect MIME type For example:
Content-Type: text/plain
when it should betext/css
Content-Type: text/plain
when it should beapplication/javascript
Chrome doesn't complain but Firefox gives more useful logs
cc @amvanbaren