From 1c739470b590ea13dc0aa67c0ecc7ea6f49b5746 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Wed, 27 Oct 2021 11:10:27 +1100 Subject: feat(ext/webstorage): use implied origin when --location not set (#12548) Closes #11882 BREAKING CHANGE: Previously when `--location` was set, the unique storage key was derived from the the URL of the location instead of just the origin. This change correctly uses just the origin. This may cause previously persisted storage to change its key and data to not be available with the same location as before. --- ext/webstorage/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/webstorage/lib.rs') diff --git a/ext/webstorage/lib.rs b/ext/webstorage/lib.rs index e7e53d983..9894c265d 100644 --- a/ext/webstorage/lib.rs +++ b/ext/webstorage/lib.rs @@ -38,8 +38,8 @@ pub fn init(origin_storage_dir: Option) -> Extension { ), ]) .state(move |state| { - if let Some(origin_storage_dir) = origin_storage_dir.clone() { - state.put(OriginStorageDir(origin_storage_dir)); + if let Some(origin_storage_dir) = &origin_storage_dir { + state.put(OriginStorageDir(origin_storage_dir.clone())); } Ok(()) }) -- cgit v1.2.3