Skip to content

Replace .Clone method with .WithContext for *http.Request in a middleware #248

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

Closed
wants to merge 1 commit into from
Closed

Replace .Clone method with .WithContext for *http.Request in a middleware #248

wants to merge 1 commit into from

Conversation

kucherenkovova
Copy link

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

🔧 Changes

Replace .Clone method with a more lightweight .WithContext for *http.Request in a middleware. WithContext returns a shallow copy while Clone does deep copy.

📚 References

🔬 Testing

@kucherenkovova kucherenkovova requested a review from a team as a code owner January 26, 2024 19:57
@kucherenkovova
Copy link
Author

FYI @ewanharris

@ewanharris
Copy link
Contributor

Thanks for the PR @kucherenkovova, could you maybe expand on why you're making the change?

Reviewing the history, it appears like this library used to use WithContext but moved away from it in #89 due to an issue raised in #62, so I'm hesitant to revert back to Clone

@kucherenkovova
Copy link
Author

@ewanharris you're right, Clone works better in this case. Closing the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants