fix: properly decode path to support all special unicode characters
This commit is contained in:
parent
518700eef6
commit
043f73ea87
2 changed files with 4 additions and 3 deletions
|
|
@ -123,7 +123,8 @@ export const repositoriesController = new Hono()
|
||||||
const { name, snapshotId } = c.req.param();
|
const { name, snapshotId } = c.req.param();
|
||||||
const { path } = c.req.valid("query");
|
const { path } = c.req.valid("query");
|
||||||
|
|
||||||
const result = await repositoriesService.listSnapshotFiles(name, snapshotId, path);
|
const decodedPath = path ? decodeURIComponent(path) : undefined;
|
||||||
|
const result = await repositoriesService.listSnapshotFiles(name, snapshotId, decodedPath);
|
||||||
|
|
||||||
c.header("Cache-Control", "max-age=300, stale-while-revalidate=600");
|
c.header("Cache-Control", "max-age=300, stale-while-revalidate=600");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -565,7 +565,7 @@ const ls = async (config: RepositoryConfig, snapshotId: string, path?: string) =
|
||||||
|
|
||||||
addRepoSpecificArgs(args, config, env);
|
addRepoSpecificArgs(args, config, env);
|
||||||
|
|
||||||
const res = await $`restic ${args}`.env(env).nothrow().quiet();
|
const res = await safeSpawn({ command: "restic", args, env });
|
||||||
await cleanupTemporaryKeys(config, env);
|
await cleanupTemporaryKeys(config, env);
|
||||||
|
|
||||||
if (res.exitCode !== 0) {
|
if (res.exitCode !== 0) {
|
||||||
|
|
@ -574,7 +574,7 @@ const ls = async (config: RepositoryConfig, snapshotId: string, path?: string) =
|
||||||
}
|
}
|
||||||
|
|
||||||
// The output is a stream of JSON objects, first is snapshot info, rest are file/dir nodes
|
// The output is a stream of JSON objects, first is snapshot info, rest are file/dir nodes
|
||||||
const stdout = res.text();
|
const stdout = res.stdout;
|
||||||
const lines = stdout
|
const lines = stdout
|
||||||
.trim()
|
.trim()
|
||||||
.split("\n")
|
.split("\n")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue