Make the linter happy
This commit is contained in:
parent
aeee46bb71
commit
51f6dcbdc5
|
@ -370,7 +370,7 @@ func (r *downloadRequest) respondFromLocalFile(
|
||||||
}).Trace("Responding with file")
|
}).Trace("Responding with file")
|
||||||
responseFile = file
|
responseFile = file
|
||||||
responseMetadata = r.MediaMetadata
|
responseMetadata = r.MediaMetadata
|
||||||
if err := r.addDownloadFilenameToHeaders(w, responseMetadata); err != nil {
|
if err = r.addDownloadFilenameToHeaders(w, responseMetadata); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -385,7 +385,7 @@ func (r *downloadRequest) respondFromLocalFile(
|
||||||
w.Header().Set("Content-Security-Policy", contentSecurityPolicy)
|
w.Header().Set("Content-Security-Policy", contentSecurityPolicy)
|
||||||
|
|
||||||
if !r.forFederation {
|
if !r.forFederation {
|
||||||
if _, err := io.Copy(w, responseFile); err != nil {
|
if _, err = io.Copy(w, responseFile); err != nil {
|
||||||
return nil, fmt.Errorf("io.Copy: %w", err)
|
return nil, fmt.Errorf("io.Copy: %w", err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -814,6 +814,7 @@ func (r *downloadRequest) GetContentLengthAndReader(contentLengthHeader string,
|
||||||
return contentLength, reader, nil
|
return contentLength, reader, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: gocyclo
|
||||||
func (r *downloadRequest) fetchRemoteFile(
|
func (r *downloadRequest) fetchRemoteFile(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
client *fclient.Client,
|
client *fclient.Client,
|
||||||
|
@ -844,7 +845,8 @@ func (r *downloadRequest) fetchRemoteFile(
|
||||||
var parseErr error
|
var parseErr error
|
||||||
if isMultiPart {
|
if isMultiPart {
|
||||||
r.Logger.Info("Downloaded file using authenticated endpoint")
|
r.Logger.Info("Downloaded file using authenticated endpoint")
|
||||||
_, params, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
var params map[string]string
|
||||||
|
_, params, err = mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -855,7 +857,8 @@ func (r *downloadRequest) fetchRemoteFile(
|
||||||
|
|
||||||
first := true
|
first := true
|
||||||
for {
|
for {
|
||||||
p, err := mr.NextPart()
|
var p *multipart.Part
|
||||||
|
p, err = mr.NextPart()
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue