mirror of https://github.com/MISP/MISP
Merge pull request #9639 from JakubOnderka/http-json-content-type
chg: [internal] Log content type when JSON could not be parsedpull/9685/head
commit
88ab8196da
|
@ -121,7 +121,8 @@ class HttpSocketResponseExtended extends HttpSocketResponse
|
||||||
try {
|
try {
|
||||||
return JsonTool::decode($this->body);
|
return JsonTool::decode($this->body);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new HttpSocketJsonException('Could not parse response as JSON.', $this, $e);
|
$contentType = $this->getHeader('content-type');
|
||||||
|
throw new HttpSocketJsonException("Could not parse HTTP response as JSON. Received Content-Type $contentType.", $this, $e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue