add cors headers, explicit local host for proxy
This commit is contained in:
parent
3ef4afbcf8
commit
5ef41da651
3 changed files with 4 additions and 3 deletions
|
|
@ -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 = [];
|
||||
|
|
|
|||
Loading…
Reference in a new issue