Skip to content

Commit

Permalink
fix empty {} Content in coFetchText causes PipelineLogs to show error
Browse files Browse the repository at this point in the history
  • Loading branch information
karthik committed May 27, 2020
1 parent 43766fd commit 9d0e724
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/public/co-fetch.js
Expand Up @@ -149,7 +149,7 @@ export const coFetchCommon = (url, method = 'GET', options = {}, timeout) => {

// If the response has no body, return promise that resolves with an empty object
if (response.headers.get('Content-Length') === '0') {
return Promise.resolve({});
return Promise.resolve(response.headers.get('Content-Type') === 'text/plain' ? '' : {});
}
if (response.headers.get('Content-Type') === 'text/plain') {
return response.text();
Expand Down

0 comments on commit 9d0e724

Please sign in to comment.