This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

bobbin/xrpc: forward X-Forwarded-For headers to knots

+15 -3
+9 -2
bobbin/crates/xrpc/src/lib.rs
··· 459 459 &CONTENT_RANGE, 460 460 ]; 461 461 462 - const FORWARDED_REQUEST_HEADERS: &[&HeaderName] = 463 - &[&RANGE, &IF_RANGE, &IF_NONE_MATCH, &IF_MODIFIED_SINCE]; 462 + static X_FORWARDED_FOR: HeaderName = HeaderName::from_static("x-forwarded-for"); 463 + 464 + const FORWARDED_REQUEST_HEADERS: &[&HeaderName] = &[ 465 + &RANGE, 466 + &IF_RANGE, 467 + &IF_NONE_MATCH, 468 + &IF_MODIFIED_SINCE, 469 + &X_FORWARDED_FOR, 470 + ]; 464 471 465 472 const KNOT_HOST_PARAM: &str = "knot"; 466 473 const REPO_PARAM: &str = "repo";
+6 -1
bobbin/crates/xrpc/tests/knot_proxy.rs
··· 568 568 } 569 569 570 570 #[tokio::test] 571 - async fn forwards_range_and_conditional_request_headers() { 571 + async fn forwards_range_conditional_and_client_address_headers() { 572 572 let h = Harness::new().await; 573 573 let tid = "3jzfcijpj2z2d"; 574 574 h.mount_repo_record(&did("did:plc:limpet"), &rkey(tid), "kelp") ··· 598 598 ("range", "bytes=0-99"), 599 599 ("if-none-match", "\"old\""), 600 600 ("if-modified-since", "Wed, 01 May 2026 00:00:00 GMT"), 601 + ("x-forwarded-for", "203.0.113.42"), 601 602 ], 602 603 ) 603 604 .await; ··· 619 620 assert_eq!( 620 621 knot_call.headers.get("if-modified-since").unwrap(), 621 622 "Wed, 01 May 2026 00:00:00 GMT", 623 + ); 624 + assert_eq!( 625 + knot_call.headers.get("x-forwarded-for").unwrap(), 626 + "203.0.113.42", 622 627 ); 623 628 } 624 629