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 fastify webhook updates when secretToken given #235

Merged
merged 1 commit into from
Jul 10, 2022

Conversation

oott123
Copy link
Contributor

@oott123 oott123 commented Jul 9, 2022

Fastify will normalize all headers to lower case form, so we always get undefined by using req.headers[SECRET_HEADER].

This PR fixes that by using toLowerCase to transform the given header key.

Not sure If CloudFlare or AWS Lambda will do that too, so they are leaved unmodified.

Fastify will normalize all headers to lower case form, so we always get `undefined` by using `req.headers[SECRET_HEADER]`.

This PR fixes that by using `toLowerCase` to transform the given header key.

Not sure If CloudFlare or AWS Lambda will do that too, so they are leaved unmodified.
@codecov-commenter
Copy link

Codecov Report

Merging #235 (206d2eb) into main (d114029) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #235   +/-   ##
=======================================
  Coverage   22.21%   22.21%           
=======================================
  Files           9        9           
  Lines        2813     2813           
  Branches       90       90           
=======================================
  Hits          625      625           
  Misses       2187     2187           
  Partials        1        1           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d114029...206d2eb. Read the comment docs.

Copy link
Member

@KnorpelSenf KnorpelSenf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great fix, thanks!

@KnorpelSenf KnorpelSenf merged commit 0b76bc0 into grammyjs:main Jul 10, 2022
@KnorpelSenf
Copy link
Member

@all-contributors add @oott123 for bug and code

@allcontributors
Copy link
Contributor

@KnorpelSenf

I've put up a pull request to add @oott123! 🎉

@KnorpelSenf
Copy link
Member

@oott123 your changes are now shipped in the patch version v1.9.1.

@oott123 oott123 deleted the patch-1 branch July 11, 2022 11:28
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.

None yet

3 participants