vagusX / koa-proxies

a koa@2.x+ proxy middleware
https://vagusx.github.io/koa-proxies/
MIT License
161 stars 44 forks source link

PATCH method doesn't proxy request body #34

Open karladler opened 5 years ago

karladler commented 5 years ago

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);
            }
        }
    }
};
luxuze commented 4 years ago

It will not proxy json data.