Skip to content

Commit

Permalink
apollo-server: Disable "x-powered-by" header (#3821)
Browse files Browse the repository at this point in the history
Do not include the Express-default `x-powered-by: express` header.

Co-authored-by: Jesse Rosenberger <[email protected]>
  • Loading branch information
pauloedurezende and abernix authored Mar 10, 2020
1 parent 2094947 commit 6597e39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The version headers in this history reflect the versions of Apollo Server itself

- `apollo-server-core`: When operating in gateway mode using the `gateway` property of the Apollo Server constructor options, the failure to initialize a schema during initial start-up, e.g. connectivity problems, will no longer result in the federated executor from being assigned when the schema eventually becomes available. This precludes a state where the gateway may never become available to serve federated requests, even when failure conditions are no longer present. [PR #3811](https://github.com/apollographql/apollo-server/pull/3811)
- `apollo-server-core`: Prevent a condition which prefixed an error message on each request when the initial gateway initialization resulted in a Promise-rejection which was memoized and re-prepended with `Invalid options provided to ApolloServer:` on each request. [PR #3811](https://github.com/apollographql/apollo-server/pull/3811)
- `apollo-server-express`: Disable the automatic inclusion of the `x-powered-by: express` header. [PR #3821](https://github.com/apollographql/apollo-server/pull/3821)

### v2.11.0

Expand Down
2 changes: 2 additions & 0 deletions packages/apollo-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ export class ApolloServer extends ApolloServerBase {
// object, so we have to create it.
const app = express();

app.disable('x-powered-by');

// provide generous values for the getting started experience
super.applyMiddleware({
app,
Expand Down

0 comments on commit 6597e39

Please sign in to comment.