Skip to content

Commit 546982a

Browse files
hatooclaude
andcommitted
Change default redirect limit to 0
Following redirects requires looking up the `Location` header on every response, which shows up as overhead in the hot path. Most load tests target a single endpoint and don't need redirection, so disable it by default; pass `-r <N>` to opt back in. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6af886c commit 546982a

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ Options:
194194
--disable-compression
195195
Disable compression.
196196
-r, --redirect <REDIRECT>
197-
Limit for number of Redirect. Set 0 for no redirection. Redirection isn't supported for HTTP/2. [default: 10]
197+
Limit for number of Redirect. Set 0 for no redirection. Redirection isn't supported for HTTP/2. [default: 0]
198198
--disable-keepalive
199199
Disable keep-alive, prevents re-use of TCP connections between different HTTP requests. This isn't supported for HTTP/2.
200200
--no-pre-lookup

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ Note: If qps is specified, burst will be ignored",
233233
disable_compression: bool,
234234
#[arg(
235235
help = "Limit for number of Redirect. Set 0 for no redirection. Redirection isn't supported for HTTP/2.",
236-
default_value = "10",
236+
default_value = "0",
237237
short = 'r',
238238
long = "redirect"
239239
)]

tests/tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ async fn get_host_with_connect_to_redirect(host: &'static str) -> String {
352352
let args = [
353353
"-n".to_string(),
354354
"1".to_string(),
355+
"-r".to_string(),
356+
"10".to_string(),
355357
format!("http://{host}/source"),
356358
"--connect-to".to_string(),
357359
format!("{host}:80:localhost:{port}"),

0 commit comments

Comments
 (0)