I wouldn't do that it like that. I would make it so that the url settings can be either strings or callables, which gives other users of this middleware the ability to specify dynamically generated URLs too (though, admittedly the usefulness of that will be limited since they won't have access to `request` in their callable).