Skip to content

Commit 17ce7e9

Browse files
committed
fix(cloudflare): fix updated api on libredirectionio
1 parent 5407665 commit 17ce7e9

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ debug = 1
1111
[dependencies]
1212
chrono = { version = "0.4.19", features = ["serde", "wasmbind"] }
1313
log = "0.4.14"
14-
redirectionio = "2.5.0"
14+
redirectionio = "2.5.1"
1515
# Uncomment the following line to debug
1616
#redirectionio = { path = "../../agent/libredirectionio/" }
1717
serde = { version = "1.0", features = ["derive"] }

src/lib.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl Action {
147147

148148
pub fn get_status_code(&mut self, response_status_code: u16) -> u16 {
149149
if let Some(action) = self.action.as_mut() {
150-
return action.get_status_code(response_status_code);
150+
return action.get_status_code(response_status_code, None);
151151
}
152152

153153
0
@@ -164,8 +164,12 @@ impl Action {
164164
}
165165

166166
let action = self.action.as_mut().unwrap();
167-
let new_headers =
168-
action.filter_headers(headers.headers, response_status_code, add_rule_ids_header);
167+
let new_headers = action.filter_headers(
168+
headers.headers,
169+
response_status_code,
170+
add_rule_ids_header,
171+
None,
172+
);
169173

170174
HeaderMap {
171175
headers: new_headers,
@@ -207,14 +211,14 @@ impl BodyFilter {
207211
pub fn filter(&mut self, data: Vec<u8>) -> Vec<u8> {
208212
match self.filter.as_mut() {
209213
None => data,
210-
Some(filter) => filter.filter(data),
214+
Some(filter) => filter.filter(data, None),
211215
}
212216
}
213217

214218
pub fn end(&mut self) -> Vec<u8> {
215219
match self.filter.as_mut() {
216220
None => Vec::new(),
217-
Some(filter) => filter.end(),
221+
Some(filter) => filter.end(None),
218222
}
219223
}
220224
}

0 commit comments

Comments
 (0)