Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
Corrected some errors in the comments.
  • Loading branch information
LXIF authored Nov 22, 2024
1 parent f586637 commit 9ee04a8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/internet_identity/tests/integration/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fn should_set_cache_control_for_fonts() -> Result<(), CallError> {
};
let index_response = http_request(&env, canister_id, &index_request)?;

// Convert body to string and find the font URL
// Convert body to string
let html = String::from_utf8(index_response.body.into_vec()).expect("Failed to parse HTML");

// Find the CSS URL in the HTML
Expand Down Expand Up @@ -161,7 +161,7 @@ fn should_set_cache_control_for_fonts() -> Result<(), CallError> {

let css_body = String::from_utf8(css_response.body.into_vec()).expect("Failed to parse CSS");

// Find the CSS URL in the HTML
// Find the Font URL in the CSS
let font_url = css_body
.lines()
.find(|line| line.contains("CircularXXWeb-Regular"))
Expand Down Expand Up @@ -208,7 +208,7 @@ fn should_set_cache_control_for_fonts() -> Result<(), CallError> {
Ok(())
}

/// Verifies that the cache-control header is set for the spa file.
/// Verifies that the cache-control header is set for the SPA file.
#[test]
fn should_set_cache_control_for_spa() -> Result<(), CallError> {
const CERTIFICATION_VERSION: u16 = 2;
Expand All @@ -225,10 +225,10 @@ fn should_set_cache_control_for_spa() -> Result<(), CallError> {
};
let index_response = http_request(&env, canister_id, &index_request)?;

// Convert body to string and find the font URL
// Convert body to string
let html = String::from_utf8(index_response.body.into_vec()).expect("Failed to parse HTML");

// Find the spa URL in the HTML
// Find the SPA URL in the HTML
let spa_url = {
let spa_suffix = "cacheable.js";
let spa_end = html
Expand All @@ -241,7 +241,7 @@ fn should_set_cache_control_for_spa() -> Result<(), CallError> {
html[prefix_start..spa_end + spa_suffix.len()].to_string()
};

// Get spa file
// Get SPA file
let request = HttpRequest {
method: "GET".to_string(),
url: spa_url,
Expand Down Expand Up @@ -287,11 +287,11 @@ fn should_set_cache_control_for_icons() -> Result<(), CallError> {
};
let index_response = http_request(&env, canister_id, &index_request)?;

// Convert body to string and find the font URL
// Convert body to string
let index_html =
String::from_utf8(index_response.body.into_vec()).expect("Failed to parse HTML");

// Find the spa URL in the HTML
// Find the SPA URL in the HTML
let spa_url = {
let spa_suffix = "cacheable.js";
let spa_end = index_html
Expand All @@ -304,7 +304,7 @@ fn should_set_cache_control_for_icons() -> Result<(), CallError> {
index_html[prefix_start..spa_end + spa_suffix.len()].to_string()
};

// Get spa file
// Get SPA file
let spa_request = HttpRequest {
method: "GET".to_string(),
url: spa_url,
Expand Down Expand Up @@ -332,7 +332,7 @@ fn should_set_cache_control_for_icons() -> Result<(), CallError> {

let spa_bytes = spa_response.body.into_vec();

// Decompress the spa bytes
// Decompress the SPA bytes
let mut decoder = GzDecoder::new(&spa_bytes[..]);
let mut spa_body = String::new();
decoder.read_to_string(&mut spa_body).unwrap();
Expand Down Expand Up @@ -403,9 +403,9 @@ fn ii_canister_serves_http_metrics() -> Result<(), CallError> {
"internet_identity_prepare_id_alias_counter",
];
let env = env();
env.advance_time(Duration::from_secs(300)); // advance time to see it reflected on the metrics endpoint
env.advance_time(Duration::from_secs(300)); // Advance time to see it reflected on the metrics endpoint

// spawn an archive so that we also get the archive related metrics
// Spawn an archive so that we also get the archive related metrics
let canister_id = install_ii_canister_with_arg(
&env,
II_WASM.clone(),
Expand Down

0 comments on commit 9ee04a8

Please sign in to comment.