mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-12-25 03:40:19 +01:00
fixes
This commit is contained in:
parent
2d5c256642
commit
5310566b81
2 changed files with 9 additions and 8 deletions
|
@ -390,6 +390,8 @@ func (s *Server) putHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
reader = r.Body
|
reader = r.Body
|
||||||
|
|
||||||
|
defer r.Body.Close()
|
||||||
|
|
||||||
if contentLength == -1 {
|
if contentLength == -1 {
|
||||||
// queue file to disk, because s3 needs content length
|
// queue file to disk, because s3 needs content length
|
||||||
var err error
|
var err error
|
||||||
|
|
|
@ -402,11 +402,11 @@ func (s *GDrive) findId(filename string, token string) (string, error) {
|
||||||
|
|
||||||
q := fmt.Sprintf("'%s' in parents and name='%s' and mimeType='%s' and trashed=false", s.rootId, token, GDriveDirectoryMimeType)
|
q := fmt.Sprintf("'%s' in parents and name='%s' and mimeType='%s' and trashed=false", s.rootId, token, GDriveDirectoryMimeType)
|
||||||
l, err := s.list(nextPageToken, q)
|
l, err := s.list(nextPageToken, q)
|
||||||
for 0 < len(l.Files) {
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for 0 < len(l.Files) {
|
||||||
for _, fi := range l.Files {
|
for _, fi := range l.Files {
|
||||||
tokenId = fi.Id
|
tokenId = fi.Id
|
||||||
break
|
break
|
||||||
|
@ -427,12 +427,11 @@ func (s *GDrive) findId(filename string, token string) (string, error) {
|
||||||
|
|
||||||
q = fmt.Sprintf("'%s' in parents and name='%s' and mimeType!='%s' and trashed=false", tokenId, filename, GDriveDirectoryMimeType)
|
q = fmt.Sprintf("'%s' in parents and name='%s' and mimeType!='%s' and trashed=false", tokenId, filename, GDriveDirectoryMimeType)
|
||||||
l, err = s.list(nextPageToken, q)
|
l, err = s.list(nextPageToken, q)
|
||||||
|
|
||||||
for 0 < len(l.Files) {
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for 0 < len(l.Files) {
|
||||||
for _, fi := range l.Files {
|
for _, fi := range l.Files {
|
||||||
|
|
||||||
fileId = fi.Id
|
fileId = fi.Id
|
||||||
|
|
Loading…
Reference in a new issue