Skip to content

Conversation

mattbeattie
Copy link
Contributor

Problem

For all API Gateway requests, a statusCode is currently only sent if it's an error. This is because the only thing developers have access to when handling a route is the response body (which is stringified and placed on the response here).

Proposed Solution

Given that any error sets the statusCode accordingly, it should be safe to assume a default statusCode of 200.

This PR does the following

  • Sets a default value for the statusCode of 200 when handling API Gateway requests
  • Updates the corresponding unit tests to ensure that the response also includes the statusCode

@coveralls
Copy link

coveralls commented Aug 18, 2017

Coverage Status

Coverage increased (+0.04%) to 95.763% when pulling 37a9f96 on mattbeattie:sets-default-statuscode into cc7367d on doomhz:master.

@coveralls
Copy link

coveralls commented Aug 18, 2017

Coverage Status

Coverage increased (+0.04%) to 95.763% when pulling b01fa89 on mattbeattie:sets-default-statuscode into cc7367d on doomhz:master.

@doomhz doomhz merged commit e33c3e1 into doomhz:master Aug 18, 2017
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.

3 participants