Skip to content

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

@tw00

Description

@tw00

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions