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

ignoreUrl did not work for GET request with param ?? #8

Open
sacsand opened this issue Sep 7, 2018 · 0 comments
Open

ignoreUrl did not work for GET request with param ?? #8

sacsand opened this issue Sep 7, 2018 · 0 comments

Comments

@sacsand
Copy link

sacsand commented Sep 7, 2018

Example request

localhost:8088/jobapply?query={"page":1,"limit":10}
->error 404 notfound

console log the "req.originalUrl"
result => " /jobapply?query=%7B%22page%22:1,%22limit%22:10%7D "
for post,put request it console as =>
"jobapply"

so the ignoredUrls.includes(req.originalUrl) cant recognize get request with param since it passing with the param.

i did apply temp fix for now..this wont work if url include '?'

in index.js

   // split the url
  const urlFiltered = req.originalUrl.split("?");`

   // pass filtered url
    if (ignoredUrls && ignoredUrls.includes(urlFiltered[0])) {
      next(); // If the url is in `ignoredUrls`, skip the autherization.
}
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