Skip to content

Commit

Permalink
set content type to text/html for playground (#2026)
Browse files Browse the repository at this point in the history
BUGFIX: the playground page is currently being served without a content type

<!--
  Thanks for filing a pull request on GraphQL Server!

  Please look at the following checklist to ensure that your PR
  can be accepted quickly:
-->

TODO:

* [x] Update CHANGELOG.md with your change (include reference to issue & this PR)
* [ ] Make sure all of the significant new logic is covered by tests
* [x] Rebase your changes on master so that they can be merged easily
* [x] Make sure all tests and linter rules pass
  • Loading branch information
jamiehodge authored and abernix committed Nov 30, 2018
1 parent d744c22 commit bcabbb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### vNEXT

- `apollo-server-micro`: Set the `Content-type` to `text/html` for GraphQL Playground. [PR #2026](https://github.com/apollographql/apollo-server/pull/2026)

### v2.2.5

- Follow-up on the update to `graphql-playground-html` in previous release by also bumping the minor version of the `graphql-playground-react` dependency to `1.7.10` — which is the version requested from the from the CDN bundle by `graphql-playground-html`. [PR #2037](https://github.com/apollographql/apollo-server/pull/2037)
Expand Down
1 change: 1 addition & 0 deletions packages/apollo-server-micro/src/ApolloServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export class ApolloServer extends ApolloServerBase {
subscriptionEndpoint: this.subscriptionsPath,
...this.playgroundOptions,
};
res.setHeader('Content-Type', 'text/html; charset=utf-8');
send(res, 200, renderPlaygroundPage(middlewareOptions));
handled = true;
}
Expand Down

0 comments on commit bcabbb7

Please sign in to comment.