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

js/css filter with query params #43

Open
kingonly opened this issue Oct 23, 2017 · 2 comments
Open

js/css filter with query params #43

kingonly opened this issue Oct 23, 2017 · 2 comments

Comments

@kingonly
Copy link

This code:
if ((lowercaseUrl.indexOf('.js', req.url.length - 3) !== -1) || (lowercaseUrl.indexOf('.css', req.url.length - 4) !== -1)) {
won't work if there are query params after the js/css path.
Am I missing something?

@No9
Copy link
Owner

No9 commented Oct 23, 2017

Yes - that looks like it doesn't manage querystrings at all.
Maybe it's time to parse lowercaseUrl with require('querystring')
happy to take a PR with tests for your scenario if you are up for it?

@kingonly
Copy link
Author

Sure. Maybe something like req.url.match(/.(js|css)([^\w]|$)/) would be better.

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

2 participants