Skip to content
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/performance improvement set headers v1.0.1 #27

Merged
merged 4 commits into from
Oct 18, 2024

Conversation

cak
Copy link
Member

@cak cak commented Oct 18, 2024

This PR improves the performance of the Secure.set_headers method by reducing redundant type checks, as discussed in issue #26.

Key changes:

  • Optimized the set_headers and set_headers_async methods to check the response type only once before looping through headers, improving efficiency when handling multiple headers.
  • Updated secure.py to reflect these changes.
  • Added additional tests to ensure the correctness of both asynchronous and synchronous header setting behavior.

Closes: #26

@cak cak merged commit 813fb2d into main Oct 18, 2024
2 checks passed
@cak cak deleted the fix/performance-improvement-set-headers-v1.0.1 branch October 18, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Performance of Secure.set_headers(response)
2 participants