Skip to content

Commit

Permalink
Fix private http events
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Nov 30, 2019
1 parent c058fa6 commit 9c90c15
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/ServerlessOffline.js
Expand Up @@ -357,7 +357,6 @@ module.exports = class ServerlessOffline {
_setupEvents() {
let serviceRuntime = this.service.provider.runtime;
const defaultContentType = 'application/json';
const { functions } = this.service.provider;
const protectedRoutes = [];

if (!serviceRuntime) {
Expand Down Expand Up @@ -396,11 +395,10 @@ module.exports = class ServerlessOffline {
return;
}

const hasPrivateHttpEvent = Object.values(functions || []).some((func) =>
(func.events || [])
.filter((e) => e.http)
.map((e) => e.http)
.some((e) => e.private),
const hasPrivateHttpEvent = Object.values(
this.service.functions || {},
).some((func) =>
(func.events || []).filter((e) => e.http).some((e) => e.http.private),
);

// for simple API Key authentication model
Expand Down

0 comments on commit 9c90c15

Please sign in to comment.