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

exclude does not match hostname per readme #41

Open
curtgrimes opened this issue May 31, 2021 · 1 comment
Open

exclude does not match hostname per readme #41

curtgrimes opened this issue May 31, 2021 · 1 comment

Comments

@curtgrimes
Copy link

The readme currently has this example for using the exclude option:

app.use(redirectSSL.create({
   exclude: ['localhost']
}))

However, redirect-ssl uses req.url which will not include the hostname like "localhost". If I make a request to http://localhost/foobar, req.url will be /foobar and I won't be able to use the exclude option in the way the readme uses it to exclude a request like this one.

@samm81
Copy link

samm81 commented Jun 14, 2021

I'm having the same issue

looks like you would have to include the req.headers.host to get the full URL, including 'localhost'

the line that curtgrimes linked (L30) would then become const url = req.headers.host + req.url || ''

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