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) ->
|
parseHostPort: (str, scheme) ->
|
||||||
sep = str.lastIndexOf(':')
|
sep = str.lastIndexOf(':')
|
||||||
|
return if sep < 0
|
||||||
port = parseInt(str.substr(sep + 1)) || 80
|
port = parseInt(str.substr(sep + 1)) || 80
|
||||||
host = str.substr(0, sep)
|
host = str.substr(0, sep)
|
||||||
|
return unless host
|
||||||
return {
|
return {
|
||||||
scheme: scheme
|
scheme: scheme
|
||||||
host: host
|
host: host
|
||||||
|
@ -158,6 +158,14 @@ module.exports = (oldOptions, i18n) ->
|
|||||||
switch rule['patternType']
|
switch rule['patternType']
|
||||||
when 'wildcard'
|
when 'wildcard'
|
||||||
pattern = rule['urlPattern']
|
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)
|
host = OmegaPac.Conditions.urlWildcard2HostWildcard(pattern)
|
||||||
if host
|
if host
|
||||||
conditionType: 'HostWildcardCondition'
|
conditionType: 'HostWildcardCondition'
|
||||||
|
Loading…
Reference in New Issue
Block a user