We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 476428a commit 381fed2Copy full SHA for 381fed2
1 file changed
mitmproxy-macos/redirector/network-extension/InterceptConf.swift
@@ -28,12 +28,17 @@ enum Pattern {
28
func matches(_ processInfo: ProcessInfo) -> Bool {
29
switch self {
30
case .pid(let pid):
31
- return processInfo.pid == pid
+ processInfo.pid == pid
32
case .process(let name):
33
if let processName = processInfo.path {
34
- return processName.contains(name)
+ if let regex = try? NSRegularExpression(pattern: name) {
35
+ let range = NSRange(location: 0, length: processName.utf16.count)
36
+ regex.firstMatch(in: processName, range: range) != nil
37
+ } else {
38
+ processName.contains(name)
39
+ }
40
} else {
- return false
41
+ false
42
}
43
44
0 commit comments