Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 59 additions & 79 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mitmproxy-contentviews/src/hex_dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl Prettify for HexDump {
))
}

fn render_priority(&self, data: &[u8], _metadata: &dyn Metadata) -> f64 {
fn render_priority(&self, data: &[u8], _metadata: &dyn Metadata) -> f32 {
if is_binary(data) {
0.5
} else {
Expand Down
2 changes: 1 addition & 1 deletion mitmproxy-contentviews/src/hex_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl Prettify for HexStream {
Ok(data_encoding::HEXLOWER.encode(data))
}

fn render_priority(&self, data: &[u8], _metadata: &dyn Metadata) -> f64 {
fn render_priority(&self, data: &[u8], _metadata: &dyn Metadata) -> f32 {
if is_binary(data) {
0.4
} else {
Expand Down
2 changes: 1 addition & 1 deletion mitmproxy-contentviews/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub trait Prettify: Send + Sync {

/// Render priority - typically a float between 0 and 1 for builtin views.
#[allow(unused_variables)]
fn render_priority(&self, data: &[u8], metadata: &dyn Metadata) -> f64 {
fn render_priority(&self, data: &[u8], metadata: &dyn Metadata) -> f32 {
0.0
}
}
Expand Down
2 changes: 1 addition & 1 deletion mitmproxy-contentviews/src/msgpack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl Prettify for MsgPack {
serde_yaml::to_string(&value).context("Failed to convert to YAML")
}

fn render_priority(&self, _data: &[u8], metadata: &dyn Metadata) -> f64 {
fn render_priority(&self, _data: &[u8], metadata: &dyn Metadata) -> f32 {
match metadata.content_type() {
Some("application/msgpack") => 1.0,
Some("application/x-msgpack") => 1.0,
Expand Down
2 changes: 1 addition & 1 deletion mitmproxy-contentviews/src/protobuf/view_grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl Prettify for GRPC {
Ok(protos.join("\n---\n\n"))
}

fn render_priority(&self, _data: &[u8], metadata: &dyn Metadata) -> f64 {
fn render_priority(&self, _data: &[u8], metadata: &dyn Metadata) -> f32 {
match metadata.content_type() {
Some("application/grpc") => 1.0,
Some("application/grpc+proto") => 1.0,
Expand Down
2 changes: 1 addition & 1 deletion mitmproxy-contentviews/src/protobuf/view_protobuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl Prettify for Protobuf {
self.prettify_with_descriptor(data, &descriptor)
}

fn render_priority(&self, _data: &[u8], metadata: &dyn Metadata) -> f64 {
fn render_priority(&self, _data: &[u8], metadata: &dyn Metadata) -> f32 {
match metadata.content_type() {
Some("application/x-protobuf") => 1.0,
Some("application/x-protobuffer") => 1.0,
Expand Down
2 changes: 1 addition & 1 deletion mitmproxy-rs/src/contentview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl Contentview {
}

/// Return the priority of this view for rendering data.
pub fn render_priority(&self, data: Vec<u8>, metadata: PythonMetadata) -> PyResult<f64> {
pub fn render_priority(&self, data: Vec<u8>, metadata: PythonMetadata) -> PyResult<f32> {
Ok(self.0.render_priority(&data, &metadata))
}

Expand Down
Loading