diff --git a/worker-sys/src/types/incoming_request_cf_properties.rs b/worker-sys/src/types/incoming_request_cf_properties.rs index b7044013b..1f37cf425 100644 --- a/worker-sys/src/types/incoming_request_cf_properties.rs +++ b/worker-sys/src/types/incoming_request_cf_properties.rs @@ -69,4 +69,7 @@ extern "C" { #[wasm_bindgen(method, catch, getter, js_name=isEUCountry)] pub fn is_eu_country(this: &IncomingRequestCfProperties) -> Result, JsValue>; + + #[wasm_bindgen(method, catch, getter, js_name=clientAcceptEncoding)] + pub fn client_accept_encoding(this: &IncomingRequestCfProperties) -> Result, JsValue>; } diff --git a/worker/src/cf.rs b/worker/src/cf.rs index dd29ca181..389b38f36 100644 --- a/worker/src/cf.rs +++ b/worker/src/cf.rs @@ -184,6 +184,11 @@ impl Cf { } .map_err(crate::Error::from) } + + /// The client's accepted encoding preferences + pub fn client_accept_encoding(&self) -> Option { + self.inner.client_accept_encoding().unwrap() + } } /// Browser-requested prioritization information.