-
Notifications
You must be signed in to change notification settings - Fork 858
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
req.url is always '/' #1000
Comments
Same problem |
The Regarding the typing issue. You can provide appropriate request and response type from your server: import type { Request, Response, NextFunction } from 'express';
createProxyMiddleware<Request, Response>{
target: config.env.TARGET_URL,
changeOrigin: true,
pathRewrite: (path, req) => req.originalUrl,
logger: console
} |
@chimurai thank you! so i guess this is desired behavior, might be a good idea to add to the docs. |
Maybe a bit hidden... It's already documented here: I'll see how I can improve the docs 👍 |
Checks
http-proxy-middleware
.Describe the bug (be clear and concise)
when upgrading http proxy middleware in nest i am unable to path rewrite using req.url
it always has the value '/'
in order for the path rewrite to work as before i need to access a variable called original url that is not strongly typed on the request object
this is my code:
Step-by-step reproduction instructions
Expected behavior (be clear and concise)
one of 2 : req.url to contain the original url
or:
originalUrl variable to be avaialble in they request type (currently http.IncomingMessage)
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: