diff --git a/gulpfile.js b/gulpfile.js index 32b6e3b..34a1ea0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -308,7 +308,12 @@ async function publishToFoundry(done) { body: JSON.stringify(payload), }); - const responseData = await response.json(); + let responseData; + if (contentType && contentType.includes('application/json')) { + responseData = await response.json(); + } else { + responseData = await response.text(); + } if (responseData.status === 'success') { console.log('Successfully published to Foundry VTT:');