@@ -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]
300300fn 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