Extracting URLs in a Redirect Chain #187
              
                Unanswered
              
          
                  
                    
                      josephkerkhof
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Hello and thank you for this library -- it's very useful.
I'm curious about a possible use case: capturing all redirects in a chain. Redirects may be server-side (like HTTP 302, 301, etc.) or they may be JavaScript redirects using
window.location.An example of possible redirect chain may be as follows:
https://example.com/give-me-a-301-> 301 redirecthttps://example.com/this-page-has-js-redirect-> JS redirecthttps://another-domain.com/-> HTTP 200 (no more redirects)I'd like to capture all of the URLs in this chain. So far I haven't been able to figure out a good way to do this. It looks like I would need the execute JavaScript middleware. I've played around with the Request object (from the
$response->getRequest()function) and other methods on theResponseobject, but so far haven't been able to figure this out.Any nudge in the right direction would be very helpful! Thank you :)
Beta Was this translation helpful? Give feedback.
All reactions