LOLINTERNETZ / vscodeoffline

Enables Visual Studio Code's extension gallery to be used in offline (air-gapped) environments. Or, run your own gallery!
https://hub.docker.com/u/lolinternet
MIT License
97 stars 31 forks source link

CORS failure when using VSCode 1.58 #13

Closed jmacdonagh closed 3 years ago

jmacdonagh commented 3 years ago

After updating to VSCode 1.58 I was no longer able to search for extensions or see recommended extensions on my offline machine. After opening the Electron console and switching to the Network tab I could see the requests were failing due to a CORS failure.

This is affecting other "alternative" extension marketplaces including open-vsx: https://github.com/microsoft/vscode/issues/128583

Luckily the fix is super simple. Update falcon to 3.0 or later and change application = falcon.API() to application = falcon.API(cors_enable=True).

I've tested the change on my end and it seems to work fine (although you might want to use falcon.App instead of falcon.API to avoid the warning on startup.

assafushy commented 3 years ago

@LOLINTERNETZ if you want me to fix it - give permissions, I will make a pr ---- love this project

forky2 commented 3 years ago

Can confirm @assafushy proposal fixes this issue. Very happy thank you!

LOLINTERNETZ commented 3 years ago

Brilliant, thanks all. Shoot it through as a PR if you're happy to. Otherwise I'll add it later in the week (I need to resync my repos :))