Skip to content
Prev Previous commit
Next Next commit
fix file path
  • Loading branch information
islandryu committed Dec 27, 2025
commit a11528473eb5e02cc5222012e42cd2975e77aa12
8 changes: 7 additions & 1 deletion src/inspector/storage_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ void StorageAgent::Wire(protocol::UberDispatcher* dispatcher) {
DispatchResponse StorageAgent::getStorageKey(
std::optional<protocol::String> frameId, protocol::String* storageKey) {
auto local_storage_file = env_->options()->localstorage_file;
*storageKey = node::url::FromFilePath(local_storage_file);
*storageKey = node::url::FromFilePath(to_absolute_path(local_storage_file));
return protocol::DispatchResponse::Success();
}

std::string StorageAgent::to_absolute_path(const std::filesystem::path& input) {
std::filesystem::path abs =
std::filesystem::weakly_canonical(std::filesystem::absolute(input));
return abs.generic_string();
}

} // namespace protocol
} // namespace inspector
} // namespace node
1 change: 1 addition & 0 deletions src/inspector/storage_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class StorageAgent : public protocol::Storage::Backend {
StorageAgent& operator=(const StorageAgent&) = delete;

private:
std::string to_absolute_path(const std::filesystem::path& input);
std::unique_ptr<protocol::Storage::Frontend> frontend_;
Environment* env_;
};
Expand Down
Loading