mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 15:08:12 -05:00
parent
c4c8971b8e
commit
bcce56320c
@ -50,8 +50,10 @@ module.exports = exports =
|
||||
|
||||
parseHostPort: (str, scheme) ->
|
||||
sep = str.lastIndexOf(':')
|
||||
return if sep < 0
|
||||
port = parseInt(str.substr(sep + 1)) || 80
|
||||
host = str.substr(0, sep)
|
||||
return unless host
|
||||
return {
|
||||
scheme: scheme
|
||||
host: host
|
||||
|
@ -158,6 +158,14 @@ module.exports = (oldOptions, i18n) ->
|
||||
switch rule['patternType']
|
||||
when 'wildcard'
|
||||
pattern = rule['urlPattern']
|
||||
if pattern[0] == '@'
|
||||
pattern = pattern.substring(1)
|
||||
else
|
||||
if pattern.indexOf('://') <= 0 and pattern[0] != '*'
|
||||
pattern = '*' + pattern
|
||||
if pattern[pattern.length - 1] != '*'
|
||||
pattern += '*'
|
||||
|
||||
host = OmegaPac.Conditions.urlWildcard2HostWildcard(pattern)
|
||||
if host
|
||||
conditionType: 'HostWildcardCondition'
|
||||
|
Loading…
Reference in New Issue
Block a user