{"action":"created","issue":{"url":"https://api.github.com/repos/postgraphql/postgraphql/issues/452","repository_url":"https://api.github.com/repos/postgraphql/postgraphql","labels_url":"https://api.github.com/repos/postgraphql/postgraphql/issues/452/labels{/name}","comments_url":"https://api.github.com/repos/postgraphql/postgraphql/issues/452/comments","events_url":"https://api.github.com/repos/postgraphql/postgraphql/issues/452/events","html_url":"https://github.com/postgraphql/postgraphql/pull/452","id":224892103,"number":452,"title":"fix(postgraphql): allow meteor-login-token request header when using enableCors option","user":{"login":"rossmartin","id":2498502,"avatar_url":"https://avatars2.githubusercontent.com/u/2498502?v=3","gravatar_id":"","url":"https://api.github.com/users/rossmartin","html_url":"https://github.com/rossmartin","followers_url":"https://api.github.com/users/rossmartin/followers","following_url":"https://api.github.com/users/rossmartin/following{/other_user}","gists_url":"https://api.github.com/users/rossmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/rossmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossmartin/subscriptions","organizations_url":"https://api.github.com/users/rossmartin/orgs","repos_url":"https://api.github.com/users/rossmartin/repos","events_url":"https://api.github.com/users/rossmartin/events{/privacy}","received_events_url":"https://api.github.com/users/rossmartin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-27T19:42:13Z","updated_at":"2017-04-29T21:07:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/postgraphql/postgraphql/pulls/452","html_url":"https://github.com/postgraphql/postgraphql/pull/452","diff_url":"https://github.com/postgraphql/postgraphql/pull/452.diff","patch_url":"https://github.com/postgraphql/postgraphql/pull/452.patch"},"body":"If you start a PostGraphQL instance using vanilla HTTP within a meteor server the `addCORSHeaders` function needs to allow the `meteor-login-token` request header.  Otherwise the request fails using a GraphQL client (I am using apollo-client).\r\n\r\nHere is how I started the instance in Meteor.\r\n```javascript\r\nhttp.createServer(postgraphql(POSTGRES_CON_STRING, schema, {\r\n  enableCors: true,\r\n  graphiql: Meteor.isDevelopment,\r\n  bodySizeLimit: '20MB'\r\n})).listen(5000);\r\n```\r\n\r\nThis is what I see when the `meteor-login-token` is now allowed - \r\n\r\n![image](https://cloud.githubusercontent.com/assets/2498502/25501156/4f52d6c6-2b57-11e7-87f9-d689179ccf52.png)\r\n\r\nI am considering using PostGraphQL in node.js [as explained here](https://github.com/postgraphql/postgraphql/blob/master/docs/library.md#custom-execution) without going through HTTP but I think there are features that I would lose because I'm using apollo-client.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/postgraphql/postgraphql/issues/comments/298194743","html_url":"https://github.com/postgraphql/postgraphql/pull/452#issuecomment-298194743","issue_url":"https://api.github.com/repos/postgraphql/postgraphql/issues/452","id":298194743,"user":{"login":"rossmartin","id":2498502,"avatar_url":"https://avatars2.githubusercontent.com/u/2498502?v=3","gravatar_id":"","url":"https://api.github.com/users/rossmartin","html_url":"https://github.com/rossmartin","followers_url":"https://api.github.com/users/rossmartin/followers","following_url":"https://api.github.com/users/rossmartin/following{/other_user}","gists_url":"https://api.github.com/users/rossmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/rossmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossmartin/subscriptions","organizations_url":"https://api.github.com/users/rossmartin/orgs","repos_url":"https://api.github.com/users/rossmartin/repos","events_url":"https://api.github.com/users/rossmartin/events{/privacy}","received_events_url":"https://api.github.com/users/rossmartin/received_events","type":"User","site_admin":false},"created_at":"2017-04-29T21:07:54Z","updated_at":"2017-04-29T21:07:54Z","body":"@benjie Thanks for all the info and options.  I'll see if I can stop Apollo/Meteor from sending this header in the first place.  The [`applyMiddleware` for apollo-client](http://dev.apollodata.com/core/network.html#networkInterfaceMiddleware) might be what I can use to solve this. "}}
{"actor":{"display_login":"rossmartin"}}