Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Allow request verification using req.rawBody #91

Closed
3 tasks done
aoberoi opened this issue Mar 7, 2019 · 3 comments
Closed
3 tasks done

Allow request verification using req.rawBody #91

aoberoi opened this issue Mar 7, 2019 · 3 comments

Comments

@aoberoi
Copy link
Contributor

aoberoi commented Mar 7, 2019

Description

Some hosting platforms (like Firebase Cloud) always parse the request body, and create the req.body property for convenience. Unfortunately, this prevents this library from being able to verify requests. However, there's a convention of placing the unparsed (but buffered) body on the req.rawBody property instead.

Using req.rawBody as a fallback for req.body during verification would allow users to deploy code using this package to more hosting platforms.

This issue is analogous to one from the @slack/events-api package. The work can likely be cribbed from this PR.

Requirements

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.
@aoberoi
Copy link
Contributor Author

aoberoi commented Mar 7, 2019

@ErwinLengkeek, beat you to making this issue 😄

@ErwinAI
Copy link
Contributor

ErwinAI commented Mar 8, 2019

@aoberoi I forgot to create it :( Did make a PR for this issue. Cannot figure out how to get the coverage up though, tried numerous things but somehow it complains about the handleError function coverage. The tests do check the output of respond() on multiple occasions though.

@shaydewael
Copy link
Contributor

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

No branches or pull requests

3 participants