Open andrewyoung1991 opened 8 years ago
+1, met the same issue, tried below two suggestions, but failed.
http://stackoverflow.com/questions/25137981/rewrite-cookie-paths-when-using-grunt-connect-proxy https://coderwall.com/p/bwrb1w/enable-post-rest-requests-in-grunt-contrib-connect
Had the same problem but turns out it is the order of the middlewares. In my case this did the trick:
middleware: function (connect, options, middlewares) { middlewares.unshift(require("grunt-connect-proxy/lib/utils").proxyRequest); middlewares.unshift(require("http-rewrite-middleware").getMiddleware( [ {from: "^/gat/(.*)$", to: "/$1"} ], { verbose: false })); return middlewares; }
so i have my back end service receiving proxy forwards at /api/0.1. my connect config looks like this:
connect is successfully reaching the api backend on GET requests exclusively, while logging
[D] server POST /api/0.1/login/ 405 0 - 0.183 ms
on any POST PUT PATCH requests before sending the request to the api backend (the backend is never sent the request).i have tried adding
changeOrigin: true, https: false, xforward: false
to the proxy config with the same results.does any one know what is going on and how i can fix this?