diff --git a/src/profile/proxy.rs b/src/profile/proxy.rs index 7a06f52f..3b7bfd4c 100644 --- a/src/profile/proxy.rs +++ b/src/profile/proxy.rs @@ -48,7 +48,7 @@ impl Proxy { for r in rules { b.push(Rule { is_enabled: r.is_enabled, - regex: r.regex, + request: r.request, url: r.url, }); } @@ -62,7 +62,7 @@ impl Proxy { pub fn matches(&self, request: &Uri) -> Option { for rule in self.rule.borrow().iter().filter(|r| r.is_enabled) { if gtk::glib::Regex::match_simple( - &rule.regex, + &rule.request, request.to_str(), gtk::glib::RegexCompileFlags::DEFAULT, gtk::glib::RegexMatchFlags::DEFAULT, diff --git a/src/profile/proxy/database.rs b/src/profile/proxy/database.rs index 05ecbe5e..11221186 100644 --- a/src/profile/proxy/database.rs +++ b/src/profile/proxy/database.rs @@ -64,11 +64,11 @@ pub fn init(tx: &Transaction) -> Result { `time` INTEGER NOT NULL, `is_enabled` INTEGER NOT NULL, `priority` INTEGER NOT NULL, - `regex` VARCHAR(255) NOT NULL, + `request` VARCHAR(1024) NOT NULL, `url` VARCHAR(255) NOT NULL, FOREIGN KEY (`profile_id`) REFERENCES `profile` (`id`), - UNIQUE (`regex`) + UNIQUE (`request`) )", [], )?; @@ -115,7 +115,7 @@ pub fn rules(tx: &Transaction, profile_id: i64) -> Result> { `time`, `is_enabled`, `priority`, - `regex`, + `request`, `url` FROM `profile_proxy_rule` @@ -130,7 +130,7 @@ pub fn rules(tx: &Transaction, profile_id: i64) -> Result> { //time: DateTime::from_unix_local(row.get(2)?).unwrap(), is_enabled: row.get(3)?, //priority: row.get(4)?, - regex: row.get(5)?, + request: row.get(5)?, url: row.get(6)?, }) })?; diff --git a/src/profile/proxy/database/rule.rs b/src/profile/proxy/database/rule.rs index 86355df5..43c9c706 100644 --- a/src/profile/proxy/database/rule.rs +++ b/src/profile/proxy/database/rule.rs @@ -1,5 +1,5 @@ pub struct Rule { pub is_enabled: bool, - pub regex: String, + pub request: String, pub url: String, } diff --git a/src/profile/proxy/rule.rs b/src/profile/proxy/rule.rs index 86355df5..43c9c706 100644 --- a/src/profile/proxy/rule.rs +++ b/src/profile/proxy/rule.rs @@ -1,5 +1,5 @@ pub struct Rule { pub is_enabled: bool, - pub regex: String, + pub request: String, pub url: String, }