mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 998372 - part 1 - lift regex construction out of FindProxyForURL; r=jmaher
This commit is contained in:
parent
04304493b7
commit
089c81cc0d
@ -308,15 +308,16 @@ class Permissions(object):
|
||||
# to (\\\\d+) makes this code work. Not sure why there would be this
|
||||
# difference between automation.py.in and this file.
|
||||
pacURL = """data:text/plain,
|
||||
var uriRegex = new RegExp('^([a-z][-a-z0-9+.]*)' +
|
||||
'://' +
|
||||
'(?:[^/@]*@)?' +
|
||||
'(.*?)' +
|
||||
'(?::(\\\\d+))?/');
|
||||
|
||||
function FindProxyForURL(url, host)
|
||||
{
|
||||
var origins = [%(origins)s];
|
||||
var regex = new RegExp('^([a-z][-a-z0-9+.]*)' +
|
||||
'://' +
|
||||
'(?:[^/@]*@)?' +
|
||||
'(.*?)' +
|
||||
'(?::(\\\\d+))?/');
|
||||
var matches = regex.exec(url);
|
||||
var matches = uriRegex.exec(url);
|
||||
if (!matches)
|
||||
return 'DIRECT';
|
||||
var isHttp = matches[1] == 'http';
|
||||
|
Loading…
Reference in New Issue
Block a user