forked from extern/homer
added more strict checking of http method to Ping service
This commit is contained in:
parent
db28142374
commit
84930a632b
@ -29,7 +29,13 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
fetchStatus: async function () {
|
||||
const method = typeof this.item.method === 'string' && this.item.method.toLowerCase() === "get" ? "GET" : "HEAD"
|
||||
const method = typeof this.item.method === 'string' ? this.item.method.toUpperCase() : 'unknown';
|
||||
|
||||
if (!['GET', 'HEAD', 'OPTION'].includes(method)) {
|
||||
console.error(`Ping: ${method} is not a supported HTTP method`);
|
||||
return;
|
||||
}
|
||||
|
||||
this.fetch("/", { method, cache: "no-cache" }, false)
|
||||
.then(() => {
|
||||
this.status = "online";
|
||||
|
Loading…
Reference in New Issue
Block a user