You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The req and res parameters extend express's Request and Response.
The documentation demonstrates using responseInterceptor to build that callback. Although the onProxyRes is going to receive a Request instance, responseInterceptor only allows you to expect an http.IncomingMessage. It seems like you should be able to expect a Request for the req argument.
This came up as an issue for me because there is information in the express Request that I need to access in my onProxyRes callback, but can't in a type-safe manner.
Step-by-step reproduction instructions
n/a
Expected behavior (be clear and concise)
responseInterceptor should type req as Request and res as Response.
How is http-proxy-middleware used in your project?
n/a
What http-proxy-middleware configuration are you using?
n/a
What OS/version and node/version are you seeing the problem?
n/a
Additional context (optional)
No response
The text was updated successfully, but these errors were encountered:
Checks
http-proxy-middleware
.Describe the bug (be clear and concise)
The
onProxyRes
option expects anOnProxyResCallback
, which is defined asThe
req
andres
parameters extend express'sRequest
andResponse
.The documentation demonstrates using
responseInterceptor
to build that callback. Although theonProxyRes
is going to receive aRequest
instance,responseInterceptor
only allows you to expect anhttp.IncomingMessage
. It seems like you should be able to expect aRequest
for thereq
argument.where
Interceptor
isThis came up as an issue for me because there is information in the express Request that I need to access in my
onProxyRes
callback, but can't in a type-safe manner.Step-by-step reproduction instructions
Expected behavior (be clear and concise)
responseInterceptor
should typereq
asRequest
andres
asResponse
.How is http-proxy-middleware used in your project?
What http-proxy-middleware configuration are you using?
What OS/version and node/version are you seeing the problem?
Additional context (optional)
No response
The text was updated successfully, but these errors were encountered: