diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 11:10:13 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 11:10:13 +0000 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /workhorse/sendfile_test.go | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) | |
download | gitlab-ce-0ea3fcec397b69815975647f5e2aa5fe944a8486.tar.gz |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'workhorse/sendfile_test.go')
-rw-r--r-- | workhorse/sendfile_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/workhorse/sendfile_test.go b/workhorse/sendfile_test.go index 0a01e410d39..f2b6da4eebd 100644 --- a/workhorse/sendfile_test.go +++ b/workhorse/sendfile_test.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "io/ioutil" + "io" "mime" "net/http" "os" @@ -53,14 +53,14 @@ func allowedXSendfileDownload(t *testing.T, contentFilename string, filePath str require.NoError(t, os.MkdirAll(cacheDir, 0755)) contentBytes := []byte("content") - require.NoError(t, ioutil.WriteFile(contentPath, contentBytes, 0644)) + require.NoError(t, os.WriteFile(contentPath, contentBytes, 0644)) resp, err := http.Get(fmt.Sprintf("%s/%s", ws.URL, filePath)) require.NoError(t, err) requireAttachmentName(t, resp, contentFilename) - actual, err := ioutil.ReadAll(resp.Body) + actual, err := io.ReadAll(resp.Body) require.NoError(t, err) require.NoError(t, resp.Body.Close()) @@ -89,7 +89,7 @@ func deniedXSendfileDownload(t *testing.T, contentFilename string, filePath stri requireAttachmentName(t, resp, contentFilename) - actual, err := ioutil.ReadAll(resp.Body) + actual, err := io.ReadAll(resp.Body) require.NoError(t, err, "read body") require.NoError(t, resp.Body.Close()) |