DICOM.getJSON :: making sure contentType is not undefined
This commit is contained in:
1 parent
30a98559c6
commit
8d4a71fd73
1 file changed
+1
-1
@@ -17,7 +17,7 @@ function makeRequest(geturl, options, callback) {
|
||||
}
|
||||
|
||||
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) {
|
||||
const errorMessage = `We only support json but "${contentType}" was sent by the server`;
|
||||
|
||||
Reference in new issue
Block a user