mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-10 15:28:47 +00:00
Enforce method
This commit is contained in:
parent
67a9f4983c
commit
19c3ac0d7e
5 changed files with 52 additions and 15 deletions
|
@ -41,6 +41,11 @@ export default async function handler(req, res) {
|
|||
const endpoint = mapping?.endpoint;
|
||||
const endpointProxy = mapping?.proxyHandler || serviceProxyHandler;
|
||||
|
||||
if (mapping.method && mapping.method !== req.method) {
|
||||
logger.debug("Unsupported method: %s", req.method);
|
||||
return res.status(403).json({ error: "Unsupported method" });
|
||||
}
|
||||
|
||||
if (!endpoint) {
|
||||
logger.debug("Unsupported service endpoint: %s", type);
|
||||
return res.status(403).json({ error: "Unsupported service endpoint" });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue