Skip to content

Commit

Permalink
feat: disable x-powered-by header (#223)
Browse files Browse the repository at this point in the history
* feat: disable x-powered-by header

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>

* fix: fix lint

Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
  • Loading branch information
grant committed Oct 2, 2020
1 parent 9e447e9 commit 1ca74ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ export function getServer(
// Subsequent parsers will be skipped when one is matched.
app.use(bodyParser.raw(rawBodySavingOptions));
app.enable('trust proxy'); // To respect X-Forwarded-For header.
// Disable Express 'x-powered-by' header:
// http://expressjs.com/en/advanced/best-practice-security.html#at-a-minimum-disable-x-powered-by-header
app.disable('x-powered-by');

registerFunctionRoutes(app, userFunction, functionSignatureType);
return http.createServer(app);
Expand Down

0 comments on commit 1ca74ae

Please sign in to comment.