Skip to content

Commit 453bb8e

Browse files
CopilotCBenoit
andcommitted
fix(test): add setter(into) to ai_gateway field and improve consistency
Co-authored-by: CBenoit <3809077+CBenoit@users.noreply.github.com>
1 parent 1891565 commit 453bb8e

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

testsuite/src/dgw_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub struct DgwConfig {
4949
#[builder(default = VerbosityProfile::DEFAULT)]
5050
verbosity_profile: VerbosityProfile,
5151
/// AI gateway configuration (requires enable_unstable: true to work).
52-
#[builder(default)]
52+
#[builder(default, setter(into))]
5353
ai_gateway: Option<AiGatewayConfig>,
5454
/// Enable unstable features (required for AI gateway).
5555
#[builder(default = false)]

testsuite/tests/cli/dgw/ai_gateway.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ async fn spawn_mock_status_server(status_code: u16, status_text: &str) -> Socket
8484
while let Ok((mut stream, _)) = listener.accept().await {
8585
let status_text = status_text.clone();
8686
tokio::spawn(async move {
87-
// Read the HTTP request headers.
87+
// Read the HTTP request headers (malformed headers are silently ignored).
8888
let mut reader = BufReader::new(&mut stream);
8989
loop {
9090
let mut line = String::new();
91-
if reader.read_line(&mut line).await.unwrap() == 0 {
91+
if reader.read_line(&mut line).await.unwrap_or(0) == 0 {
9292
break;
9393
}
9494
if line.trim().is_empty() {

0 commit comments

Comments
 (0)