Fix: fix some instances of HTTTP

pull/4287/head
shamoon 2 months ago
parent d87d347aa3
commit 535be37bef
No known key found for this signature in database

@ -54,7 +54,7 @@ export default async function beszelProxyHandler(req, res) {
if (!token) { if (!token) {
[status, token] = await login(loginUrl, widget.username, widget.password, service); [status, token] = await login(loginUrl, widget.username, widget.password, service);
if (status !== 200) { if (status !== 200) {
logger.debug(`HTTTP ${status} logging into npm api: ${token}`); logger.debug(`HTTP ${status} logging into npm api: ${token}`);
return res.status(status).send(token); return res.status(status).send(token);
} }
} }
@ -68,12 +68,12 @@ export default async function beszelProxyHandler(req, res) {
}); });
if (status === 403) { if (status === 403) {
logger.debug(`HTTTP ${status} retrieving data from npm api, logging in and trying again.`); logger.debug(`HTTP ${status} retrieving data from npm api, logging in and trying again.`);
cache.del(`${tokenCacheKey}.${service}`); cache.del(`${tokenCacheKey}.${service}`);
[status, token] = await login(loginUrl, widget.username, widget.password, service); [status, token] = await login(loginUrl, widget.username, widget.password, service);
if (status !== 200) { if (status !== 200) {
logger.debug(`HTTTP ${status} logging into npm api: ${data}`); logger.debug(`HTTP ${status} logging into npm api: ${data}`);
return res.status(status).send(data); return res.status(status).send(data);
} }

@ -21,7 +21,7 @@ export default async function calendarProxyHandler(req, res) {
if (contentType) res.setHeader("Content-Type", contentType); if (contentType) res.setHeader("Content-Type", contentType);
if (status !== 200) { if (status !== 200) {
logger.debug(`HTTTP ${status} retrieving data from integration URL ${integration.url} : ${data}`); logger.debug(`HTTP ${status} retrieving data from integration URL ${integration.url} : ${data}`);
return res.status(status).send(data); return res.status(status).send(data);
} }

@ -56,7 +56,7 @@ export default async function npmProxyHandler(req, res) {
if (!token) { if (!token) {
[status, token] = await login(loginUrl, widget.username, widget.password, service); [status, token] = await login(loginUrl, widget.username, widget.password, service);
if (status !== 200) { if (status !== 200) {
logger.debug(`HTTTP ${status} logging into npm api: ${token}`); logger.debug(`HTTP ${status} logging into npm api: ${token}`);
return res.status(status).send(token); return res.status(status).send(token);
} }
} }
@ -70,12 +70,12 @@ export default async function npmProxyHandler(req, res) {
}); });
if (status === 403) { if (status === 403) {
logger.debug(`HTTTP ${status} retrieving data from npm api, logging in and trying again.`); logger.debug(`HTTP ${status} retrieving data from npm api, logging in and trying again.`);
cache.del(`${tokenCacheKey}.${service}`); cache.del(`${tokenCacheKey}.${service}`);
[status, token] = await login(loginUrl, widget.username, widget.password, service); [status, token] = await login(loginUrl, widget.username, widget.password, service);
if (status !== 200) { if (status !== 200) {
logger.debug(`HTTTP ${status} logging into npm api: ${data}`); logger.debug(`HTTP ${status} logging into npm api: ${data}`);
return res.status(status).send(data); return res.status(status).send(data);
} }

@ -138,7 +138,7 @@ export default async function omadaProxyHandler(req, res) {
const sitesResponseData = JSON.parse(data); const sitesResponseData = JSON.parse(data);
if (status !== 200 || sitesResponseData.errorCode > 0) { if (status !== 200 || sitesResponseData.errorCode > 0) {
logger.debug(`HTTTP ${status} getting sites list: ${sitesResponseData.msg}`); logger.debug(`HTTP ${status} getting sites list: ${sitesResponseData.msg}`);
return res return res
.status(status) .status(status)
.json({ error: { message: "Error getting sites list", url, data: sitesResponseData } }); .json({ error: { message: "Error getting sites list", url, data: sitesResponseData } });

Loading…
Cancel
Save