-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix _replace_builtin #107
Fix _replace_builtin #107
Conversation
…h, not a class object
@Gallaecio could you please add a link (or short note) to the issue that this fix is going to fix? |
PR description added. |
MaxRequestsPerSeedDownloaderMiddleware: 100, | ||
OffsiteMiddleware: None, | ||
AllowOffsiteMiddleware: 500, | ||
BUILTIN_OFFSITE_MIDDLEWARE_IMPORT_PATH: None, | ||
AllowOffsiteMiddleware: 50, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can see from the code, this change in order (the offsite middleware will now come before the max-requests-per-seed middleware) is OK, probably even for the best. I hope it does not come back to bite me…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) It's interesting as all tests for the addon passed - might be this case was not covered :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The add-on was injecting the built-in middleware manually (the lines removed) before calling _replace_builtin
, that’s why it was not caught by the tests.
_replace_builtin
is meant to find a component, disable it, and replace it by another with the same priority value.However, due to a variable typo I probably made myself, this function was failing to see built-in components (those in the
*_BASE
settings), so they were never disabled, causing the built-in offsite middleware to remain enabled, which in turn caused offsite request to be ignored even if allowed through meta (that only our custom middleware takes into account).