Skip to content

Commit

Permalink
fix: Handle re-written URLs in HTTP signature validation (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
bflorian committed May 13, 2021
1 parent 7359590 commit 69b89c5
Show file tree
Hide file tree
Showing 3 changed files with 491 additions and 161 deletions.
6 changes: 6 additions & 0 deletions lib/smart-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,12 @@ class SmartApp {
return this._handleCallback(request.body, responders.httpResponder(response, this._log))
}

// Work-around to issue with http-signature
// See also: https://github.com/joyent/node-http-signature/issues/87
if (request.originalUrl) {
request.url = request.originalUrl
}

const isAuthorized = await this._authorizer.isAuthorized(request)
if (isAuthorized) {
return this._handleCallback(request.body, responders.httpResponder(response, this._log))
Expand Down

0 comments on commit 69b89c5

Please sign in to comment.