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

Loop detection refactoring #21

Merged
merged 3 commits into from
Aug 3, 2015
Merged

Conversation

jhedstrom
Copy link
Contributor

Attempt to address #16.

@Berdir
Copy link
Member

Berdir commented Apr 30, 2015

I don't think this is correct, it is global for a reason. You can have a loop that involves more than one redirect. In fact, those are the common cases. Something like content/title -> content/old-title -> content/title.

It could even involve another module, so for example, you might have a redirect from the alias to node/5, and then node/5 is being redirected away again by globalredirect. Stuff like that.

@jhedstrom
Copy link
Contributor Author

Hmm, it completely blows up on load testing (of different URLs from same
IP), so at the very least should be configurable.
On Apr 30, 2015 3:17 PM, "Sascha Grossenbacher" [email protected]
wrote:

I don't think this is correct, it is global for a reason. You can have a
loop that involves more than one redirect. In fact, those are the common
cases. Something like content/title -> content/old-title -> content/title.

It could even involve another module, so for example, you might have a
redirect from the alias to node/5, and then node/5 is being redirected away
again by globalredirect. Stuff like that.


Reply to this email directly or view it on GitHub
#21 (comment).

@Berdir
Copy link
Member

Berdir commented Apr 30, 2015

I see, load testing of redirects, I assume?

I think the best option is to go with option b) in #16. That basically means that when we find a matching redirect, we pass the redirect that we create again through findMatchingRedirect, repeatedly until we find one that doesn't find one. That won't find all cases as mentioned above, but it should find some.

Making it configurable should also be fine, but might not be necessary with this approach?

@jhedstrom jhedstrom changed the title Loop detection should be per-uri, not global. Loop detection configurable May 1, 2015
@jhedstrom
Copy link
Contributor Author

This makes detection configurable. Option b in #16 sounds good, but I don't have the bandwidth to pursue that at the moment.

This will also be an issue with web crawlers (eg, Google), not just load testing.

@jhedstrom jhedstrom force-pushed the redirect-loop-fix branch 4 times, most recently from 60e2af5 to f4d9bc7 Compare May 4, 2015 19:11
@jhedstrom jhedstrom changed the title Loop detection configurable Loop detection refactoring May 4, 2015
@jhedstrom
Copy link
Contributor Author

This latest attempt removes flood-based detection, and pursues option b in #16.

@jhedstrom jhedstrom force-pushed the redirect-loop-fix branch 2 times, most recently from 899f259 to e2f73f3 Compare May 5, 2015 17:50
@jhedstrom
Copy link
Contributor Author

This should fix the failing tests. I added tests for the loop detection as well.

@jhedstrom jhedstrom force-pushed the redirect-loop-fix branch 2 times, most recently from d4d0161 to 5d2002f Compare July 20, 2015 20:37
@jhedstrom jhedstrom force-pushed the redirect-loop-fix branch from 5d2002f to 5f2e017 Compare July 31, 2015 16:33
Berdir added a commit that referenced this pull request Aug 3, 2015
@Berdir Berdir merged commit cecc5f0 into md-systems:8.x-1.x Aug 3, 2015
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

Successfully merging this pull request may close these issues.

2 participants