DICOM.getJSON :: making sure contentType is not undefined
This commit is contained in:
parent
30a98559c6
commit
8d4a71fd73
@ -17,7 +17,7 @@ function makeRequest(geturl, options, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var req = http.request(requestOpt, function(resp) {
|
var req = http.request(requestOpt, function(resp) {
|
||||||
const contentType = resp.headers['content-type'].split(';')[0];
|
const contentType = (resp.headers['content-type'] || '').split(';')[0];
|
||||||
|
|
||||||
if (jsonHeaders.indexOf(contentType) == -1) {
|
if (jsonHeaders.indexOf(contentType) == -1) {
|
||||||
const errorMessage = `We only support json but "${contentType}" was sent by the server`;
|
const errorMessage = `We only support json but "${contentType}" was sent by the server`;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user