You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vhost will not match if the last char is *. making it harder to develop locally.
Ex:
constexpress=require('express')constvhost=require('vhost')// ConfigurationconstPORT=3000;constHOST="localhost";constapp=express()constok=express()constfail=express()ok.use('',(req,res,next)=>{res.send('ok found\n')})fail.use('',(req,res,next)=>{res.send('fail found\n')})app.use(vhost('ok.lvh.me',ok))//lvh.me will always resolv to 127.0.0.1app.use(vhost('fail.*',fail))//This will not matchapp.use('',(req,res,next)=>{res.status(404).send('Vhost Not found\n')})app.listen(PORT,HOST,()=>{console.log(`Starting Proxy at ${HOST}:${PORT}`);});
Calling the server will have the following results: $ curl 'http://ok.lvh.me:3000/' ok found $ curl 'http://fail.lvh.me:3000/' Vhost Not found
The text was updated successfully, but these errors were encountered:
MagnusKlingenberg
changed the title
Vhost's ending in wildcard do not match
Vhost's ending in wildcard do not match. Version 3.0.2
Apr 27, 2021
Vhost will not match if the last char is *. making it harder to develop locally.
Ex:
Calling the server will have the following results:
$ curl 'http://ok.lvh.me:3000/' ok found
$ curl 'http://fail.lvh.me:3000/' Vhost Not found
The text was updated successfully, but these errors were encountered: