(response: &mut HttpResponse)
| 25 | } |
| 26 | |
| 27 | pub 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 |
| 50 | fn cbor_encode(value: &impl Serialize) -> Vec<u8> { |
no test coverage detected