gnat/csrf-starlette-fastapi

state object has no get

mybigman opened this issue · 1 comments

Did you test it before closing the other one :)

File "/home/champ/projects/v8-starlette/./app/middleware/csrf_middleware2.py", line 29, in dispatch
    if request.state.get("post"):
  File "/home/champ/projects/v8-starlette/__pypackages__/3.10/lib/starlette/datastructures.py", line 702, in __getattr__
    raise AttributeError(message.format(self.__class__.__name__, key))
AttributeError: 'State' object has no attribute 'get'
gnat commented

Thanks. Fixed and tested now.