Skip to content
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

how pass along request to next middleware in stack? #1498

Open
hpl002 opened this issue Jan 5, 2021 · 1 comment
Open

how pass along request to next middleware in stack? #1498

hpl002 opened this issue Jan 5, 2021 · 1 comment

Comments

@hpl002
Copy link

hpl002 commented Jan 5, 2021

Request terminates in middleware. There is however an option "option.onProxyRes" that allows you to further handle the request as you wish in the onProxyRes handler.

However, this handler only takes proxyRes, req, res as args. How may i then call the next middleware in my stack?

Excerpt from readme:

function onProxyRes(proxyRes, req, res) {
  proxyRes.headers['x-added'] = 'foobar'; // add new header to response
  delete proxyRes.headers['x-removed']; // remove header from response
}

Fairly new to express so please excuse me if this is a silly question..

Thanks!

@hpl002 hpl002 closed this as completed Jan 5, 2021
@hpl002 hpl002 reopened this Jan 6, 2021
@hpl002
Copy link
Author

hpl002 commented Jan 6, 2021

This issue fundamentally builds on issue that fixed in #1415

Provided this merge, then it would be possible to force a 404 status to pass the request along to the next middleware. Ideally this would be configurable as an option..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant