From cb287fb651f8a24f63f278d34db35b186f742945 Mon Sep 17 00:00:00 2001 From: ldm0 Date: Sun, 23 Aug 2026 01:15:53 +0800 Subject: [PATCH] fix(cli): apply redirect wait to terminal 3xx pages --- moli-test-support/src/routes_wait.rs | 100 +++++++++++- moli/src/app.rs | 2 +- moli/src/app/readiness.rs | 4 +- ...r_navigation.rs => redirect_navigation.rs} | 41 ++--- moli/src/cli.rs | 5 +- moli/tests/fetch_cli.rs | 148 ++++++++++++++++++ 6 files changed, 268 insertions(+), 32 deletions(-) rename moli/src/app/{http_error_navigation.rs => redirect_navigation.rs} (67%) diff --git a/moli-test-support/src/routes_wait.rs b/moli-test-support/src/routes_wait.rs index b3d08a3c7a..f0bffdf247 100644 --- a/moli-test-support/src/routes_wait.rs +++ b/moli-test-support/src/routes_wait.rs @@ -71,6 +71,36 @@ const WAIT_UNTIL_INTERVAL_FETCH_HTML: &str = "
0
"; const WAIT_UNTIL_SLOW_STATIC_HTML: &str = "
slow-main=ready
"; +const WAIT_UNTIL_REDIRECT_STATUS_NAVIGATION_HTML: &str = r#" +terminal 302 navigation +
redirect-status=challenge
+ +"#; +const WAIT_UNTIL_REDIRECT_STATUS_NAVIGATION_FINAL_HTML: &str = r#" +terminal 302 navigation passed +
redirect-status=navigation-done
+"#; +const WAIT_UNTIL_REDIRECT_STATUS_NO_NAVIGATION_HTML: &str = r#" +terminal 302 +
redirect-status=terminal
+ +"#; const WAIT_UNTIL_HTTP_ERROR_NAVIGATION_CHALLENGE_HTML: &str = "403 challenge
http-error-navigation=challenge
"; const WAIT_UNTIL_HTTP_ERROR_LATE_NAVIGATION_CHALLENGE_HTML: &str = "late 403 challenge
http-error-navigation=late-challenge
"; const WAIT_UNTIL_READINESS_HTTP_ERROR_CHALLENGE_HTML: &str = r#" @@ -192,6 +222,19 @@ window.addEventListener('load', () => {
slow-500-head
"#; const WAIT_UNTIL_SLOW_STREAMING_500_TAIL: &[u8] = br#"
slow-500-tail
"#; +const WAIT_UNTIL_SLOW_STREAMING_302_HEAD: &[u8] = br#" +slow streaming 302
slow-302-head
"#; +const WAIT_UNTIL_SLOW_STREAMING_302_TAIL: &[u8] = + br#"
slow-302-tail
"#; const WAIT_UNTIL_SLOW_STREAMING_403_NAVIGATION_HEAD: &[u8] = br#" slow streaming 403 navigation