Skip to content

Commit 078ccea

Browse files
authored
Replace httpbin.org with httpbingo.org (#83)
* Replace httpbin.org with httpbingo.org to avoid timeouts * Replace Cloudflare endpoint with httpbingo in host header security test
1 parent cc18154 commit 078ccea

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

tests/linux_integration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ mod tests {
391391
.arg("alpine:latest")
392392
.arg("sh")
393393
.arg("-c")
394-
.arg("wget -q -O- --timeout=2 http://httpbin.org/get 2>&1 || echo 'BLOCKED'");
394+
.arg("wget -q -O- --timeout=2 https://httpbingo.org/get 2>&1 || echo 'BLOCKED'");
395395

396396
let output = cmd
397397
.output()

tests/weak_integration.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -293,23 +293,23 @@ fn test_server_mode() {
293293
/// Verifies that httpjail corrects mismatched Host headers to prevent
294294
/// CDN routing bypasses and other Host header attacks.
295295
///
296-
/// This test uses httpbin.org/headers which echoes back the received headers,
296+
/// This test uses httpbingo.org/headers which echoes back the received headers,
297297
/// allowing us to verify that httpjail corrects the Host header to match the
298298
/// actual destination URL rather than relying on external service blocking behavior.
299299
#[test]
300300
fn test_host_header_security() {
301301
use std::process::Command;
302302

303303
// Test 1: Direct curl with mismatched Host header
304-
// httpbin.org/headers echoes back all headers it receives
304+
// httpbingo.org/headers echoes back all headers it receives
305305
let direct_result = Command::new("curl")
306306
.args([
307307
"-s",
308308
"-H",
309309
"Host: evil.com",
310310
"--max-time",
311311
"5",
312-
"http://httpbin.org/headers",
312+
"https://httpbingo.org/headers",
313313
])
314314
.output()
315315
.expect("Failed to execute curl directly");
@@ -318,8 +318,7 @@ fn test_host_header_security() {
318318

319319
// Verify curl sends the mismatched Host header as-is
320320
assert!(
321-
direct_stdout.contains("\"Host\": \"evil.com\"")
322-
|| direct_stdout.contains("\"Host\":\"evil.com\""),
321+
direct_stdout.contains("\"Host\"") && direct_stdout.contains("evil.com"),
323322
"Direct curl should send mismatched Host header (got: {})",
324323
direct_stdout
325324
);
@@ -335,7 +334,7 @@ fn test_host_header_security() {
335334
"Host: evil.com",
336335
"--max-time",
337336
"5",
338-
"http://httpbin.org/headers",
337+
"https://httpbingo.org/headers",
339338
])
340339
.execute();
341340

@@ -345,14 +344,14 @@ fn test_host_header_security() {
345344

346345
// Verify httpjail corrected the Host header to match the actual destination
347346
assert!(
348-
stdout.contains("\"Host\": \"httpbin.org\"") || stdout.contains("\"Host\":\"httpbin.org\""),
349-
"Httpjail should correct Host header to httpbin.org (got: {})",
347+
stdout.contains("\"Host\"") && stdout.contains("httpbingo.org"),
348+
"Httpjail should correct Host header to httpbingo.org (got: {})",
350349
stdout
351350
);
352351

353352
// Verify the mismatched header was NOT forwarded
354353
assert!(
355-
!stdout.contains("\"Host\": \"evil.com\"") && !stdout.contains("\"Host\":\"evil.com\""),
354+
!stdout.contains("evil.com"),
356355
"Httpjail should not forward mismatched Host header evil.com (got: {})",
357356
stdout
358357
);

0 commit comments

Comments
 (0)