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

rails/http: monkey-patch with prepend instead of method chaining #1162

Merged
merged 1 commit into from
May 12, 2021

Conversation

kyrylo
Copy link
Contributor

@kyrylo kyrylo commented May 12, 2021

Fixes #1161 (missing prepend instrumentation leads to stack level too deep
error)

Since we don't care about Ruby 1.9 support, we can safely rely on prepend to
monkey-patch methods safely. This is more robust because nobody will overwrite
our implementation (unless they forget to call super) and we will also respect
other libraries that monkey-patch HTTP::Client#perform.

Fixes #1161 (missing prepend instrumentation leads to stack level too deep
error)

Since we don't care about Ruby 1.9 support,  we can safely rely on `prepend` to
monkey-patch methods safely. This is more robust because nobody will overwrite
our implementation (unless they forget to call `super`) and we will also respect
other libraries that monkey-patch `HTTP::Client#perform`.
@kyrylo kyrylo merged commit 185d4bf into master May 12, 2021
@kyrylo kyrylo deleted the 1161-http-client-prepend branch May 12, 2021 15:26
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.

missing prepend instrumentation leads to stack level too deep error
2 participants