mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-12-24 03:10:19 +01:00
error checking
This commit is contained in:
parent
6fa94d6631
commit
4a1697ee60
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue