Closed KonradCichocki7 closed 2 months ago
I have no problem changing that one - I have that in a work area - however this does seem to be an issue with injector - there is nothing I can tell that requires or suggests that all annotations have to be imported at run time.
I want to use the flask security together with an injector (a dependency injection framework for python). But when I enable csrf all requests fail. After some digging I found out that injector tries to scan any method that is going to be invoked during the request handling (in this case
csrf_cookie_handler
) to see if it needs to inject anything.Since
csrf_cookie_handler
is not annotated with any@inject
annotations it should happily ignore it, but it fails on finding type hints for this function. Fixing it should be a matter of taking the import statement for theResponse
out of the if statement. Gonna submit a PR in a moment