-
Notifications
You must be signed in to change notification settings - Fork 474
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 webhook requests for headers with a symbol key #977
Fix webhook requests for headers with a symbol key #977
Conversation
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.
Looks good, thank you for adding a test as well!
Seems we got a couple of rubocop failures, could you please address those so we can merge?
2032792
to
a4e8dbc
Compare
@paulomarg Fixed! |
Sorry for the delay in getting back to you @phylor, but it seems like we still have one failure when running the sorbet checks ( |
E.g. the clearance session is called `:clearance` and it then fails with the error: ``` ShopifyAPITest::Webhooks::WebhookRequestTest#test_with_symbol_headers: NoMethodError: undefined method `sub' for :clearance:Symbol Did you mean? stub ```
a4e8dbc
to
12abba9
Compare
No problem, sorry for the failures 🙂 Rebased on |
@paulomarg Sorry for the trouble. We're now getting Rubocop issues not relevant to my changes. Shall I still fix them in this PR? |
No need, we'll fix those! Thank you. |
Description
Webhooks fail when there is a header with a symbol as a key:
This happens e.g. when using Clearance, which adds
:clearance
as a header, containing the Clearance session. This means that webhooks will always fail as soon as you include Clearance into the project. Its middleware always adds that header, even if there is no authenticated request.How has this been tested?
Test case within this PR.
Checklist: