Closed kucherenkovova closed 7 months ago
FYI @ewanharris
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
@ewanharris you're right, Clone
works better in this case. Closing the PR.
📝 Checklist
🔧 Changes
Replace
.Clone
method with a more lightweight.WithContext
for *http.Request in a middleware.WithContext
returns a shallow copy whileClone
does deep copy.📚 References
https://pkg.go.dev/net/http#Request.Clone
https://pkg.go.dev/net/http#Request.WithContext