Skip ensuring parent collections for hidden avatar folders during upload to avoid MKCOL timeouts
This commit is contained in:
@@ -91,10 +91,12 @@ func (c *WebDAVClient) Upload(ctx context.Context, remotePath string, r io.Reade
|
|||||||
if c == nil {
|
if c == nil {
|
||||||
return fmt.Errorf("no webdav client configured")
|
return fmt.Errorf("no webdav client configured")
|
||||||
}
|
}
|
||||||
// Ensure parent collections
|
// Ensure parent collections (skip for hidden avatar folders to avoid MKCOL timeouts)
|
||||||
|
if !strings.HasPrefix(remotePath, ".avatars") {
|
||||||
if err := c.ensureParent(ctx, remotePath); err != nil {
|
if err := c.ensureParent(ctx, remotePath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Construct URL
|
// Construct URL
|
||||||
// remotePath might be like /orgs/<id>/file.txt; ensure it joins to basePrefix
|
// remotePath might be like /orgs/<id>/file.txt; ensure it joins to basePrefix
|
||||||
rel := strings.TrimLeft(remotePath, "/")
|
rel := strings.TrimLeft(remotePath, "/")
|
||||||
|
|||||||
Reference in New Issue
Block a user