Skip to content

Commit 123e63f

Browse files
committed
more safe PAC replacement regex. /PROXY.../ ... -> /\bPROXY.../ which means PROXY should start at word boundary.
1 parent 8642e0e commit 123e63f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

proxy-login-automator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function createPacServer(local_host, local_port, remote_host, remote_port, buf_p
167167
}).on('end', function () {
168168
var s = Buffer.concat(buf_ary).toString();
169169
buf_ary = [];
170-
s = s.replace(/PROXY\s+([^'":;\s]+):(\d+)/g, function (_, host, port) {
170+
s = s.replace(/\bPROXY\s+([^'":;\s]+):(\d+)/g, function (_, host, port) {
171171
var remoteAddr = host + ':' + port;
172172
var _local_port = proxyAddrMap[remoteAddr];
173173
if (!_local_port) {

0 commit comments

Comments
 (0)