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

Global apiKey query param not detected #92

Closed
comino opened this issue Oct 25, 2019 · 2 comments · Fixed by #93
Closed

Global apiKey query param not detected #92

comino opened this issue Oct 25, 2019 · 2 comments · Fixed by #93

Comments

@comino
Copy link
Collaborator

comino commented Oct 25, 2019

When using a top level defined apiKey as query parameter, the apiKey is not recognized in requests.

$ curl localhost:8000/v1/check?apiKey=testtest

{"message":"query parameter 'apiKey' required","errors":[{"path":"/v1/check","message":"query parameter 'apiKey' required"}]}

Reson is that we are looking in the headers, not in the query param ;)

            else if (scheme.in === 'query') {
                if (!req.headers[scheme.name]) {
                    throw Error(`query parameter '${scheme.name}' required`);
                }
            }

Will send a PR

@comino
Copy link
Collaborator Author

comino commented Oct 25, 2019

Send PR: #93

@cdimascio
Copy link
Owner

@comino. Thanks for the PR. I'll get this merged in and published. Thank you!

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

Successfully merging a pull request may close this issue.

2 participants