aboutsummaryrefslogtreecommitdiff
path: root/mediaapi/routing/download.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-08-05 10:26:59 +0100
committerGitHub <noreply@github.com>2022-08-05 10:26:59 +0100
commitc8935fb53f122b367eda61ec7811c406193d29ba (patch)
tree928c78461943f180dde6b2b4e4cd1d26792248f1 /mediaapi/routing/download.go
parent1b7f84250a46b401eccb89acafdef1b379f2dbc0 (diff)
Do not use `ioutil` as it is deprecated (#2625)
Diffstat (limited to 'mediaapi/routing/download.go')
-rw-r--r--mediaapi/routing/download.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/mediaapi/routing/download.go b/mediaapi/routing/download.go
index 10b25a5c..c9299b1f 100644
--- a/mediaapi/routing/download.go
+++ b/mediaapi/routing/download.go
@@ -19,7 +19,6 @@ import (
"encoding/json"
"fmt"
"io"
- "io/ioutil"
"mime"
"net/http"
"net/url"
@@ -695,7 +694,7 @@ func (r *downloadRequest) GetContentLengthAndReader(contentLengthHeader string,
// We successfully parsed the Content-Length, so we'll return a limited
// reader that restricts us to reading only up to this size.
- reader = ioutil.NopCloser(io.LimitReader(*body, parsedLength))
+ reader = io.NopCloser(io.LimitReader(*body, parsedLength))
contentLength = parsedLength
} else {
// Content-Length header is missing. If we have a maximum file size
@@ -704,7 +703,7 @@ func (r *downloadRequest) GetContentLengthAndReader(contentLengthHeader string,
// ultimately it will get rewritten later when the temp file is written
// to disk.
if maxFileSizeBytes > 0 {
- reader = ioutil.NopCloser(io.LimitReader(*body, int64(maxFileSizeBytes)))
+ reader = io.NopCloser(io.LimitReader(*body, int64(maxFileSizeBytes)))
}
contentLength = 0
}