MCPcopy Create free account
hub / github.com/dfinity/orbit / add_skip_certification_headers

Function add_skip_certification_headers

libs/orbit-essentials/src/http.rs:27–47  ·  view source on GitHub ↗
(response: &mut HttpResponse)

Source from the content-addressed store, hash-verified

25}
26
27pub fn add_skip_certification_headers(response: &mut HttpResponse) {
28 if let Some(certified_data) = data_certificate() {
29 let witness = cbor_encode(&skip_certification_asset_tree());
30 let expr_path = ["http_expr", "<*>"];
31 let expr_path = cbor_encode(&expr_path);
32
33 response.headers.push(HeaderField(
34 IC_CERTIFICATE_EXPRESSION_HEADER.to_string(),
35 skip_certification_cel_expr(),
36 ));
37 response.headers.push(HeaderField(
38 IC_CERTIFICATE_HEADER.to_string(),
39 format!(
40 "certificate=:{}:, tree=:{}:, expr_path=:{}:, version=2",
41 BASE64.encode(certified_data),
42 BASE64.encode(witness),
43 BASE64.encode(expr_path)
44 ),
45 ));
46 }
47}
48
49// Encoding
50fn cbor_encode(value: &impl Serialize) -> Vec<u8> {

Callers 2

http_requestFunction · 0.85
http_requestFunction · 0.85

Calls 5

data_certificateFunction · 0.85
cbor_encodeFunction · 0.85
HeaderFieldClass · 0.85

Tested by

no test coverage detected