koa-proxies icon indicating copy to clipboard operation
koa-proxies copied to clipboard

PATCH method doesn't proxy request body

Open karladler opened this issue 5 years ago • 1 comments

It seems like proxying methods like PATCH having some payload in the body doesn't arrive at server. Did I do something wrong or is it a bug?

Works totally fine for GET requests but PATCH fails.

const proxyTable = {
    'proxy/api/': {
        target: `${targeturl}`,
        rewrite: path => path.replace(/\/proxy/, ''),
        logs: true,
        changeOrigin: true,
        headers: {
            Authorization: `Bearer ${token}`
        },
        secure: true,
        events: {
            error(err, req, res) {
                log.error(err);
            }
        }
    }
};

karladler avatar Dec 06 '18 11:12 karladler

It will not proxy json data.

luxuze avatar Dec 13 '19 07:12 luxuze