Skip to content

Commit

Permalink
Merge c6fe594 into 228ae44
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffdutton committed Apr 30, 2019
2 parents 228ae44 + c6fe594 commit e51f01a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/events/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ class Request {
return this.headers[field.toLowerCase()]
}

/**
* Returns the unmodified Lambda Proxy Event
*
* @returns {object} - Lambda event
*/
getLambdaEvent () {
return this.rawLambdaEvent
}

/**
* Returns true if the incoming request’s “Content-Type” HTTP header field matches the MIME type
* specified by the type parameter. Returns false otherwise.
Expand Down
6 changes: 6 additions & 0 deletions test/events/request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,11 @@ describe('events', () => {
expect(req.context('requestId')).to.eq('08e3e2d0-daca-11e6-8d84-394b4374a71a')
})
})

describe('#getLambdaEvent', () => {
it('should return the raw lambda event', () => {
expect(new Request(lambdaEvent).getLambdaEvent()).to.eq(lambdaEvent)
})
})
})
})

0 comments on commit e51f01a

Please sign in to comment.