fix(安全): 修复HTML导出中的XSS漏洞并清理调试日志
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
refactor(日志): 替换console.log为tracing日志系统 style(代码): 移除未使用的代码和依赖项 feat(测试): 添加端到端测试文档和CI工作流 docs(变更日志): 更新CHANGELOG.md记录0.1.0版本变更 perf(构建): 更新依赖版本并优化CI流程
This commit is contained in:
@@ -26,7 +26,10 @@ impl MemoryStore {
|
||||
// Parse SQLite URL to extract file path
|
||||
// Format: sqlite:/path/to/db or sqlite://path/to/db
|
||||
if database_url.starts_with("sqlite:") {
|
||||
let path_part = database_url.strip_prefix("sqlite:").unwrap();
|
||||
let path_part = database_url.strip_prefix("sqlite:")
|
||||
.ok_or_else(|| ZclawError::StorageError(
|
||||
format!("Invalid database URL format: {}", database_url)
|
||||
))?;
|
||||
|
||||
// Skip in-memory databases
|
||||
if path_part == ":memory:" {
|
||||
@@ -34,7 +37,10 @@ impl MemoryStore {
|
||||
}
|
||||
|
||||
// Remove query parameters (e.g., ?mode=rwc)
|
||||
let path_without_query = path_part.split('?').next().unwrap();
|
||||
let path_without_query = path_part.split('?').next()
|
||||
.ok_or_else(|| ZclawError::StorageError(
|
||||
format!("Invalid database URL path: {}", path_part)
|
||||
))?;
|
||||
|
||||
// Handle both absolute and relative paths
|
||||
let path = std::path::Path::new(path_without_query);
|
||||
|
||||
Reference in New Issue
Block a user