mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-23 07:42:10 +00:00
Merge branch 'hotfix-release'
This commit is contained in:
commit
e743a49c62
@ -92,7 +92,15 @@ const pingfetch = async (url, method, body, headers) => {
|
||||
*/
|
||||
response = await fetch(url, { ...payload });
|
||||
res = new Date().getTime() - now;
|
||||
data = await response.json();
|
||||
try {
|
||||
/* Try getting response json body
|
||||
If this fails, body is either empty or not valid json
|
||||
and data should return null
|
||||
*/
|
||||
data = await response.json();
|
||||
} catch (e) {
|
||||
//
|
||||
}
|
||||
if (urlObject.protocol === 'https:') {
|
||||
const certificate = await sslCert.get(urlObject.hostname);
|
||||
if (certificate) {
|
||||
@ -121,7 +129,15 @@ const pingfetch = async (url, method, body, headers) => {
|
||||
: { agent: httpAgent }),
|
||||
});
|
||||
res = new Date().getTime() - now;
|
||||
data = await response.json();
|
||||
try {
|
||||
/* Try getting response json body
|
||||
If this fails, body is either empty or not valid json
|
||||
and data should return null
|
||||
*/
|
||||
data = await response.json();
|
||||
} catch (e) {
|
||||
//
|
||||
}
|
||||
if (urlObject.protocol === 'https:') {
|
||||
const certificate = await sslCert.get(urlObject.hostname);
|
||||
if (certificate) {
|
||||
|
Loading…
Reference in New Issue
Block a user