File tree 1 file changed +3
-1
lines changed
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use crate::headers::Headers;
4
4
use crate :: http:: Method ;
5
5
6
6
use js_sys:: { self , Object } ;
7
+ use serde:: Serialize ;
7
8
use wasm_bindgen:: { prelude:: * , JsValue } ;
8
9
9
10
/// Optional options struct that contains settings to apply to the `Request`.
@@ -146,6 +147,7 @@ impl From<&CfProperties> for JsValue {
146
147
fn from ( props : & CfProperties ) -> Self {
147
148
let obj = js_sys:: Object :: new ( ) ;
148
149
let defaults = CfProperties :: default ( ) ;
150
+ let serializer = serde_wasm_bindgen:: Serializer :: new ( ) . serialize_maps_as_objects ( true ) ;
149
151
150
152
set_prop (
151
153
& obj,
@@ -191,7 +193,7 @@ impl From<&CfProperties> for JsValue {
191
193
set_prop (
192
194
& obj,
193
195
& JsValue :: from ( "cacheTtlByStatus" ) ,
194
- & serde_wasm_bindgen :: to_value ( & ttl_status_map ) . unwrap_or_default ( ) ,
196
+ & ttl_status_map . serialize ( & serializer ) . unwrap_or_default ( ) ,
195
197
) ;
196
198
197
199
set_prop (
You can’t perform that action at this time.
0 commit comments