Skip to content

Commit

Permalink
Remove _transform_headers()
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraSuegami committed Dec 18, 2024
1 parent 2cc1eea commit db64f39
Showing 1 changed file with 2 additions and 31 deletions.
33 changes: 2 additions & 31 deletions src/dns_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fn transform(raw: TransformArgs) -> HttpResponse {
Err(e) => HttpResponse {
status: Nat::from(500u64),
body: e.as_bytes().to_vec(),
headers: _transform_headers(),
headers: vec![],
..Default::default()
},
}
Expand Down Expand Up @@ -218,43 +218,14 @@ fn _transform(raw: TransformArgs) -> Result<HttpResponse, String> {
return Ok(HttpResponse {
status: raw.response.status.clone(),
body: pubkey_bytes.n().to_bytes_be().to_vec(),
headers: _transform_headers(),
headers: vec![],
..Default::default()
});
}
}
Err("No key found".to_string())
}

fn _transform_headers() -> Vec<HttpHeader> {
vec![
HttpHeader {
name: "Content-Security-Policy".to_string(),
value: "default-src 'self'".to_string(),
},
HttpHeader {
name: "Referrer-Policy".to_string(),
value: "strict-origin".to_string(),
},
HttpHeader {
name: "Permissions-Policy".to_string(),
value: "geolocation=(self)".to_string(),
},
HttpHeader {
name: "Strict-Transport-Security".to_string(),
value: "max-age=63072000".to_string(),
},
HttpHeader {
name: "X-Frame-Options".to_string(),
value: "DENY".to_string(),
},
HttpHeader {
name: "X-Content-Type-Options".to_string(),
value: "nosniff".to_string(),
},
]
}

ic_cdk::export_candid!();

#[cfg(test)]
Expand Down

0 comments on commit db64f39

Please sign in to comment.