Skip to content

Commit 3dfe4e4

Browse files
committed
prevent future footgun
1 parent 382b468 commit 3dfe4e4

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎crates/pbs/src/mev_boost/get_header.rs‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,10 @@ pub async fn get_header<S: BuilderApiState>(
150150
// Forward the caller's Accept preference to the relay so the relay
151151
// returns data in the format the BN expects, avoiding decode→re-encode.
152152
// Always offer both encodings as fallback so a format-limited relay
153-
// still returns a bid (PBS converts if needed). Safe to unwrap:
154-
// handle_get_header already validated the Accept header before calling
155-
// into get_header.
156-
let caller_accept = get_accept_types(&req_headers)
157-
.expect("Accept header validated upstream in handle_get_header");
153+
// still returns a bid (PBS converts if needed).
154+
let caller_accept = get_accept_types(&req_headers).inspect_err(|err| {
155+
error!(%err, "error parsing accept header");
156+
})?;
158157
let relay_accept = AcceptedEncodings {
159158
primary: caller_accept.primary,
160159
fallback: Some(match caller_accept.primary {

0 commit comments

Comments
 (0)