chimurai / http-proxy-middleware

:zap: The one-liner node.js http-proxy middleware for connect, express, next.js and more
MIT License
10.6k stars 828 forks source link

Allow custom Http Method like LIST #975

Closed Zetanova closed 3 months ago

Zetanova commented 3 months ago

Describe the feature you'd love to see

The proxy response with 400 Bad Request with http request LIST I could not find any options to allow other http methods over the config.

Tried with the default webpack-dev-server provided with angular 17

Additional context (optional)

No response

chimurai commented 3 months ago

LIST is not a official HTTP request method, that's why you are getting a 400 response.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods https://datatracker.ietf.org/doc/html/rfc7231#section-4.3

Zetanova commented 3 months ago

The proxy is blocking the request and there is no option for configuration/allow custom http methods.

A direct connection to the Vault API worked of course without issues.

chimurai commented 3 months ago

Think it's the dev server blocking the request. Not the proxy.

Supported methods: https://expressjs.com/en/api.html#routing-methods

Workaround

https://developer.hashicorp.com/vault/api-docs

The API documentation uses LIST as the HTTP verb, but you can still use GET with the ?list=true query string.