From 8649ddb42024cb7de81726dcde0ddbdc5488f362 Mon Sep 17 00:00:00 2001 From: Amos Wenger Date: Fri, 28 Aug 2020 12:31:49 +0200 Subject: [PATCH] Parse broth API response properly --- src/main/broth/package.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/broth/package.ts b/src/main/broth/package.ts index d6784cb79..fe95f1215 100644 --- a/src/main/broth/package.ts +++ b/src/main/broth/package.ts @@ -107,10 +107,10 @@ export class Package implements PackageLike { throw new Error(`got HTTP ${res.statusCode} while fetching (${url})`); } - const versionsRes = res.body as VersionsRes; + const versionsRes = JSON.parse(res.body) as VersionsRes; if (!versionsRes.versions) { throw new Error( - `got invalid response from broth server: expected JSON object with 'broth' field, got: ${JSON.stringify( + `got invalid response from broth server: expected JSON object with 'versions' field, got: ${JSON.stringify( versionsRes )}` );