-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Create SecureHeadersMiddleware.py #507
Conversation
Also need to add tests. Since you made a branch from this repo I can add them tonight if I get around to it. Test really would be just passing in a request object, running the after method and then asserting some of the headers were set correctly. |
@josephmancuso I wasn't sure about branch that's why I choose 2.1 |
test cases for secure headers
def after(self): | ||
"""Run This Middleware After The Route Executes. | ||
""" | ||
from config import middleware |
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.
@vaibhavmule this is important to note. Since we are adding it in this file, we can't import it or we will get a circular import. so we pass it in this after method instead to lazy load it. Not doing this was causing the middleware import to fail
Closes #502