Skip to content

Commit bd3b1f0

Browse files
committed
Don't panic when getting the ja4
Use the correct error so we return None.
1 parent 309b206 commit bd3b1f0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/src/wiggle_abi/req_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl FastlyHttpReq for Session {
304304
ja4_max_len: u32,
305305
nwritten_out: GuestPtr<u32>,
306306
) -> Result<(), Error> {
307-
Err(Error::NotAvailable("Client TLS JA4 hash"))
307+
Err(Error::ValueAbsent)
308308
}
309309

310310
fn downstream_compliance_region(

test-fixtures/src/bin/downstream-req.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ fn main() {
3333
assert_eq!(client_req.get_tls_client_hello(), None);
3434
assert_eq!(client_req.get_tls_protocol(), None);
3535
assert_eq!(client_req.get_tls_protocol_bytes(), None);
36+
assert_eq!(client_req.get_tls_ja3_md5(), None);
37+
assert_eq!(client_req.get_tls_ja4(), None);
3638
// NOTE: This currently fails, waiting on a patch to land in the fastly crate
3739
// assert_eq!(client_req.get_tls_raw_client_certificate(), None);
3840
assert_eq!(client_req.get_tls_raw_client_certificate_bytes(), None);

0 commit comments

Comments
 (0)