Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not passing passThroughHeaders into options of mount results in Error #13

Open
tw00 opened this issue Dec 30, 2020 · 0 comments
Open

Not passing passThroughHeaders into options of mount results in Error #13

tw00 opened this issue Dec 30, 2020 · 0 comments

Comments

@tw00
Copy link

tw00 commented Dec 30, 2020

Not passing passThroughHeaders into mount(..., { passThroughHeaders: [] }) results in the following error:

node_modules/graphql-rest-router/Router.js:70
                ? [...this.passThroughHeaders, ...options.passThroughHeaders]
                                                          ^
TypeError: options.passThroughHeaders is not iterable
    at Router.mount (/Users/tw/Projects/curator-stack/api/node_modules/graphql-rest-router/Router.js:70:59)
    at makeGQLRestRouter (/Users/tw/Projects/curator-stack/api/tests/load-test.js:37:6)

Changing

-      const passThroughHeaders = Boolean(options)
+      const passThroughHeaders = Boolean(options) && Boolean(options.passThroughHeaders)

here

const passThroughHeaders = Boolean(options)

should fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant