DOnt error on server bug of not sending contenttype

This commit is contained in:
Mitra Ardron 2018-10-28 20:59:11 -07:00
parent 6484d3132f
commit 1c86efcbb3

View File

@ -78,7 +78,7 @@ httptools.p_httpfetch = async function(httpurl, init, {wantstream=false}={}) { /
return response.body; // Note property while json() or text() are functions
} else if (contenttype === "application/json") {
return response.json(); // promise resolving to JSON
} else if ((contenttype !== "undefined") && contenttype.startsWith("text")) { // Note in particular this is used for responses to store
} else if ((typeof contenttype !== "undefined") && contenttype.startsWith("text")) { // Note in particular this is used for responses to store
return response.text();
} else { // Typically application/octetStream when don't know what fetching
return new Buffer(await response.arrayBuffer()); // Convert arrayBuffer to Buffer which is much more usable currently