diff --git a/scripts/axolotl/publish-skin-site.mjs b/scripts/axolotl/publish-skin-site.mjs index 3283fa9..f02c568 100644 --- a/scripts/axolotl/publish-skin-site.mjs +++ b/scripts/axolotl/publish-skin-site.mjs @@ -43,6 +43,7 @@ export async function publishSkinSite({ response = await fetchImpl(`${baseUrl.replace(/\/$/, '')}/starlight/${route}`, { method, headers: { + Accept: 'application/json', Authorization: `Bearer ${token}`, ...(body && !chunk ? { 'Content-Type': 'application/json' } : {}), }, @@ -72,7 +73,7 @@ export async function publishSkinSite({ } catch { throw new Error(`Skin site ${route}: invalid JSON response`) } - if (result?.success !== true || !result.payload) { + if (result?.success === false || result?.error || !result?.payload) { throw new Error( `Skin site ${route}: ${result?.errorMessage || 'request was rejected or payload is missing'}`, ) diff --git a/scripts/axolotl/publish-skin-site.test.mjs b/scripts/axolotl/publish-skin-site.test.mjs index 269cf26..83183ec 100644 --- a/scripts/axolotl/publish-skin-site.test.mjs +++ b/scripts/axolotl/publish-skin-site.test.mjs @@ -33,7 +33,8 @@ function apiFixture(bytes, options = {}) { ...(state === 'ready' ? { release } : {}), ...(state === 'failed' ? { errorMessage: 'Invalid archive manifest' } : {}), }) - const reply = (payload) => Response.json({ success: true, payload }) + // The frontend derives success from HTTP status; the wire envelope only needs payload. + const reply = (payload) => Response.json({ payload }) return { chunks, events,