-
-
Notifications
You must be signed in to change notification settings - Fork 956
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
Configuring chained requests via express middlewares #1091
Comments
Could you set up a RunKit example? Or create an example repository? I can't recreate the issue by myself. |
@retrocausal Friendly ping. |
@szmarczak Sorry, I havent been able to create an example repository. I meant to reply earlier, and could not do so. Should I close this and check later once I have an example repo? |
Please try 11.0.0-beta.1 out and let me know if it's fixed or not. |
Friendly ping. |
Closing due to a lack of response. |
What would you like to discuss?
I have a project where I am using express to proxy requests to a backend from the browser
I found an issue that might be related, But was not too sure.
the express configuration is pretty straightforward , and looks like so:
middlewares use got via a wrapper object . This is by design, so every route handler need not import got and configure options
the wrapper does nothing but provide an
execute
method, that looks like so:the problem is, once middleware1 finishes and
next()
is called within the stack, middleware 2changes the
url/source
,method
, adds anAuthorization
token received by middleware1and creates a new wrapper - then calls
wrapper.execute
this call simply times out. or, gives me an
ECONNRESET
message in the catch block.Authorization
token, and it works fine.The issue only happens when I use a multiple middleware stack on a route in express with got
Or, even when i dont use chained middlewares, and try to execute two got requests in a single middleware. the second request still fails.
I am using got v10+
I have not configured a timeout or a retry in got's options, almost everything apart from whats needed is left to its default value
...
Checklist
The text was updated successfully, but these errors were encountered: