Skip to content

Commit

Permalink
Merge b96db62 into 1ba557c
Browse files Browse the repository at this point in the history
  • Loading branch information
YPetremann committed Aug 17, 2018
2 parents 1ba557c + b96db62 commit 75551a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Expand Up @@ -24,6 +24,8 @@ var ASTERISK_REPLACE = '([^.]+)'
var END_ANCHORED_REGEXP = /(?:^|[^\\])(?:\\\\)*\$$/
var ESCAPE_REGEXP = /([.+?^=!:${}()|[\]/\\])/g
var ESCAPE_REPLACE = '\\$1'
var MULTIPLE_REGEXP = /\(\[\^\.\]\+\)\(\[\^\.\]\+\)\\\./g
var MULTIPLE_REPLACE = '(.+\\\.)?'

/**
* Create a vhost middleware.
Expand Down Expand Up @@ -111,7 +113,7 @@ function isregexp (val) {

function hostregexp (val) {
var source = !isregexp(val)
? String(val).replace(ESCAPE_REGEXP, ESCAPE_REPLACE).replace(ASTERISK_REGEXP, ASTERISK_REPLACE)
? String(val).replace(ESCAPE_REGEXP, ESCAPE_REPLACE).replace(ASTERISK_REGEXP, ASTERISK_REPLACE).replace(MULTIPLE_REGEXP, MULTIPLE_REPLACE)
: val.source

// force leading anchor matching
Expand Down

0 comments on commit 75551a0

Please sign in to comment.