Browse Source

修复Mac原生客户端上传失败的BUG

main
zhouxin 4 years ago
parent
commit
1718782b60
  1. 4
      src/main/java/com/github/zxbu/webdavteambition/store/AliYunDriverFileSystemStore.java

4
src/main/java/com/github/zxbu/webdavteambition/store/AliYunDriverFileSystemStore.java

@ -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…
Cancel
Save