Fix PROPFIND /
This commit is contained in:
parent
55d561b789
commit
0e6f45e368
@ -319,6 +319,7 @@ export default {
|
||||
}
|
||||
break;
|
||||
case '1': {
|
||||
if (resource_path !== "") {
|
||||
let object = await bucket.head(resource_path);
|
||||
if (object === null && resource_path.endsWith('/')) {
|
||||
object = await bucket.head(resource_path.slice(0, -1));
|
||||
@ -355,6 +356,7 @@ export default {
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
let page = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<multistatus xmlns="DAV:">`;
|
||||
@ -362,7 +364,7 @@ export default {
|
||||
let cursor: string | undefined = undefined;
|
||||
do {
|
||||
var r2_objects = await bucket.list({
|
||||
prefix: resource_path.endsWith('/') ? resource_path : resource_path + '/',
|
||||
prefix: resource_path.endsWith('/') || resource_path === "" ? resource_path : resource_path + '/',
|
||||
delimiter: '/',
|
||||
cursor: cursor,
|
||||
include: ['httpMetadata', 'customMetadata'],
|
||||
@ -400,6 +402,7 @@ export default {
|
||||
}
|
||||
break;
|
||||
case 'infinity': {
|
||||
if (resource_path !== "") {
|
||||
let object = await bucket.head(resource_path);
|
||||
if (object === null && resource_path.endsWith('/')) {
|
||||
object = await bucket.head(resource_path.slice(0, -1));
|
||||
@ -436,6 +439,7 @@ export default {
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
let page = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<multistatus xmlns="DAV:">`;
|
||||
@ -443,7 +447,7 @@ export default {
|
||||
let cursor: string | undefined = undefined;
|
||||
do {
|
||||
var r2_objects = await bucket.list({
|
||||
prefix: resource_path.endsWith('/') ? resource_path : resource_path + '/',
|
||||
prefix: resource_path.endsWith('/') || resource_path === "" ? resource_path : resource_path + '/',
|
||||
cursor: cursor,
|
||||
include: ['httpMetadata', 'customMetadata'],
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user