Sfoglia il codice sorgente

error checking

tags/v1.1.0
Andrea Spacca 4 anni fa
parent
commit
4a1697ee60
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. +6
    -0
      server/storage.go

+ 6
- 0
server/storage.go Vedi File

@@ -152,6 +152,9 @@ func (s *S3Storage) Head(token string, filename string) (contentType string, con

// content type , content length
response, err := s.s3.HeadObject(headRequest)
if err != nil {
return
}

if response.ContentType != nil {
contentType = *response.ContentType
@@ -188,6 +191,9 @@ func (s *S3Storage) Get(token string, filename string) (reader io.ReadCloser, co
}

response, err := s.s3.GetObject(getRequest)
if err != nil {
return
}

if response.ContentType != nil {
contentType = *response.ContentType


Caricamento…
Annulla
Salva