修复Mac原生客户端上传失败的BUG
This commit is contained in:
parent
394eb7b6db
commit
1718782b60
|
@ -19,6 +19,7 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.security.Principal;
|
import java.security.Principal;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class AliYunDriverFileSystemStore implements IWebdavStore {
|
public class AliYunDriverFileSystemStore implements IWebdavStore {
|
||||||
|
@ -107,7 +108,8 @@ public class AliYunDriverFileSystemStore implements IWebdavStore {
|
||||||
|
|
||||||
long contentLength = request.getContentLength();
|
long contentLength = request.getContentLength();
|
||||||
if (contentLength < 0) {
|
if (contentLength < 0) {
|
||||||
contentLength = Long.parseLong(request.getHeader("content-length"));
|
contentLength = Long.parseLong(Optional.ofNullable(request.getHeader("content-length"))
|
||||||
|
.orElse(request.getHeader("X-Expected-Entity-Length")));
|
||||||
}
|
}
|
||||||
aliYunDriverClientService.uploadPre(resourceUri, contentLength, content);
|
aliYunDriverClientService.uploadPre(resourceUri, contentLength, content);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue