File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,16 @@ void StorageAgent::Wire(protocol::UberDispatcher* dispatcher) {
2121DispatchResponse StorageAgent::getStorageKey (
2222 std::optional<protocol::String> frameId, protocol::String* storageKey) {
2323 auto local_storage_file = env_->options ()->localstorage_file ;
24- *storageKey = node::url::FromFilePath (local_storage_file);
24+ *storageKey = node::url::FromFilePath (to_absolute_path ( local_storage_file) );
2525 return protocol::DispatchResponse::Success ();
2626}
2727
28+ std::string StorageAgent::to_absolute_path (const std::filesystem::path& input) {
29+ std::filesystem::path abs =
30+ std::filesystem::weakly_canonical (std::filesystem::absolute (input));
31+ return abs.generic_string ();
32+ }
33+
2834} // namespace protocol
2935} // namespace inspector
3036} // namespace node
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ class StorageAgent : public protocol::Storage::Backend {
2424 StorageAgent& operator =(const StorageAgent&) = delete ;
2525
2626 private:
27+ std::string to_absolute_path (const std::filesystem::path& input);
2728 std::unique_ptr<protocol::Storage::Frontend> frontend_;
2829 Environment* env_;
2930};
You can’t perform that action at this time.
0 commit comments