fix: window on ssr error + cors problem with launcher meta (#5856)

This commit is contained in:
Calum H.
2026-04-19 00:55:57 +01:00
committed by GitHub
parent 9b3fe6390e
commit 065759d1b8
4 changed files with 41 additions and 5 deletions

View File

@@ -13,6 +13,11 @@ export class LauncherMetaManifestV0Module extends AbstractModule {
/**
* Get the loader manifest for a given loader platform.
*
* launcher-meta refuses CORS preflights that ask for the `Content-Type`
* header (returns 403), so we strip the default `Content-Type: application/json`
* the abstract client sets — these are body-less GETs and don't need it.
* Without this the browser preflight is rejected and the GET never fires.
*
* @param loader - Loader platform (fabric, forge, quilt, neo)
*/
public async getManifest(loader: string): Promise<LauncherMeta.Manifest.v0.Manifest> {
@@ -21,6 +26,7 @@ export class LauncherMetaManifestV0Module extends AbstractModule {
version: `${loader}/v0`,
method: 'GET',
skipAuth: true,
headers: { 'Content-Type': '' },
})
}
}