-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ResponseInterceptor recipe types mismatch #632
Comments
Thanks for the kind words! Think this has been fixed in this PR #60. But it hasn't been published yet. |
Just published
onProxyRes: (
proxyRes: http.IncomingMessage,
req: http.IncomingMessage,
res: http.ServerResponse
): void Hopefully it won't give conflicts anymore. Let me know if the issue persists. |
Wow. Thanks for taking care of it right away 👍 I will check on it! |
Due to the change of the req type from Request to |
@alsoscotland Could you share the code snippet you're using? |
@chimurai sure. Thanks for the quick response:
|
Does this break the documentation? I'm getting |
yarn why http-proxy-middleware
ORnpm ls http-proxy-middleware
output (mask private folder names with *****)comet@0.0.1 ***** ├─┬ @types/http-proxy-middleware@1.0.0 │ └── http-proxy-middleware@2.0.0 deduped └── http-proxy-middleware@2.0.0
http-proxy-middleware
.Describe the bug (be clear and concise)
TL; DR;
When using responseInterceptor on onProxyRes, types doesn't match.
In detail...
I wanted to handle response. So I used a function on [onProxyRes] (#97 (comment)).
but I didn't get the response as I wanted..
(Response was broken and I think it's related to decompressing... it's not the issue I wanna report anyways)
So, instead of using this
I used
responseInterceptor
with your recipeI'm using Typescript also, and unfortunately,
responseInterceptor's return value doesn't comply to onProxyRes.
Step-by-step reproduction instructions
Expected behavior (be clear and concise)
responseInterceptor
expects arguments as belowbut if I want to use it directly onProxyReq,
types doesn't match.
Because
onProxyRes
expects this type.It works if I use
any
as expected type... or convert types before passing it to responseInterceptor.But wanted to ask you first about this issue
What http-proxy-middleware configuration are you using?
What OS/version and node/version are you seeing the problem?
Additional context (optional)
I appreciate your work and wonderful recipes!
Happy to use it and contribute :) thanks ❤️
The text was updated successfully, but these errors were encountered: