Skip to content

Commit

Permalink
Fix detection of undefined endpoint response headers
Browse files Browse the repository at this point in the history
  • Loading branch information
james-relyea committed Mar 26, 2019
1 parent a7abe3b commit ff4a534
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Expand Up @@ -788,7 +788,8 @@ class Offline {

if (integration === 'lambda') {

const endpointResponseHeaders = endpoint.response ? endpoint.response.headers : {};
const endpointResponseHeaders = (typeof endpoint.response != 'undefined'
&& typeof endpoint.response.headers != 'undefined') ? endpoint.response.headers : {};

Object.keys(endpointResponseHeaders)
.filter(key => typeof endpointResponseHeaders[key] === 'string' && /^'.*?'$/.test(endpointResponseHeaders[key]))
Expand Down

0 comments on commit ff4a534

Please sign in to comment.