MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / decoded_http_body

Function decoded_http_body

packages/server/src/devtools.rs:1115–1127  ·  view source on GitHub ↗
(headers: &str, body: &[u8])

Source from the content-addressed store, hash-verified

1113}
1114
1115fn decoded_http_body(headers: &str, body: &[u8]) -> Result<Vec<u8>, String> {
1116 if header_value(headers, "transfer-encoding").is_some_and(|value| {
1117 value
1118 .split(',')
1119 .any(|encoding| encoding.trim().eq_ignore_ascii_case("chunked"))
1120 }) {
1121 return decode_chunked_body(body);
1122 }
1123 Ok(content_length(headers)
1124 .and_then(|length| body.get(..length))
1125 .unwrap_or(body)
1126 .to_vec())
1127}
1128
1129fn decode_chunked_body(mut body: &[u8]) -> Result<Vec<u8>, String> {
1130 let mut decoded = Vec::new();

Calls 4

header_valueFunction · 0.85
content_lengthFunction · 0.85
decode_chunked_bodyFunction · 0.70
getMethod · 0.65