http-proxy-middleware
http-proxy-middleware copied to clipboard
can't rewrite request cookie
I want to rewrite request cookie using following code, but didn't work.
proxy.on('proxyReq', function (proxyReq, req, res) {
proxyReq.setHeader('cookie', 'SESSION=123');
});
And is there a way to find API of proxyReq Object?
me two
me too
me too
@stephenliu1944 you should set headers Access-Control-Allow-Credentials
proxyRes.headers['Access-Control-Allow-Credentials'] = true
proxyRes.headers['Access-Control-Allow-Headers'] = 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild'
proxyRes.headers['Access-Control-Allow-Methods'] = 'PUT, POST, GET, DELETE, OPTIONS'