Skip to content

Commit 3f0db65

Browse files
authored
fix: add additional optional cf properties (#777)
1 parent 415094a commit 3f0db65

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

worker-sys/src/types/incoming_request_cf_properties.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern "C" {
1212
pub fn colo(this: &IncomingRequestCfProperties) -> Result<String, JsValue>;
1313

1414
#[wasm_bindgen(method, catch, getter)]
15-
pub fn asn(this: &IncomingRequestCfProperties) -> Result<u32, JsValue>;
15+
pub fn asn(this: &IncomingRequestCfProperties) -> Result<Option<u32>, JsValue>;
1616

1717
#[wasm_bindgen(method, catch, getter, js_name=asOrganization)]
1818
pub fn as_organization(this: &IncomingRequestCfProperties) -> Result<Option<String>, JsValue>;

worker/src/cf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl Cf {
3333
}
3434

3535
/// The Autonomous System Number (ASN) of the request, e.g. `395747`
36-
pub fn asn(&self) -> u32 {
36+
pub fn asn(&self) -> Option<u32> {
3737
self.inner.asn().unwrap()
3838
}
3939

0 commit comments

Comments
 (0)