Skip to content

Commit

Permalink
More APIs: to_json and update_status_code
Browse files Browse the repository at this point in the history
  • Loading branch information
quangIO committed Jan 14, 2024
1 parent 46a5998 commit 21ed171
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ impl<'m, 'r> Transaction<'m, 'r> {
self.inner.as_mut().processLogging();
Ok(())
}

pub fn to_json(&mut self, parts: u16) -> String {
let json = self.inner.as_mut().toJSON((parts as i32).into());
json.to_string()
}

pub fn update_status_code(&mut self, status: u16) {
self.inner.as_mut().updateStatusCode((status as i32).into());
}
}

impl ModSecurity {
Expand Down

0 comments on commit 21ed171

Please sign in to comment.