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

FollowRedirects middleware: copy opts from response env #414

Merged

Commits on Sep 4, 2020

  1. FollowRedirects middleware: copy opts from response env

    Middlewares that come after FollowRedirects might use `opts` for state
    they need to keep if they are called multiple times.
    
    The specific use case we have that requires this: Our pool for
    gun requires explicit checkout/checkin of the connection. We have a
    middleware after FollowRedirects that checks out a connection, passes
    it to adapter opts, requests and then checks the connection back in.
    However, if `body_as: :chunks` options is used, we, obviously,
    can't checkin the connection in the middleware as it needs to be passed
    to the client after leaving the middleware. But if there was a redirect
    to a different host we want to checkin the old connection and checkout
    a new one ourselves. So we want to check if adapter options already
    have a connection in them and checkin it if present.
    rinpatch committed Sep 4, 2020
    Configuration menu
    Copy the full SHA
    3a2789d View commit details
    Browse the repository at this point in the history