add cors headers, explicit local host for proxy

This commit is contained in:
Stewart Allen 2026-03-01 22:58:17 -05:00
commit 5ef41da651
3 changed files with 4 additions and 3 deletions

View file

@ -1,6 +1,6 @@
module.exports = async (server) => {
const { api, env, path, util } = server;
const { api, env, handler, path, util } = server;
server.inject("kiri", "main.js");
@ -17,6 +17,7 @@ module.exports = async (server) => {
};
function proxy_post(req, res, next) {
handler.addCORS(req, res);
if (req.method === 'POST') {
let { url, headers } = req;
let chunks = [];