Commit 941b0c37 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Fix downloading artifacts entry in main_test.go

parent d9baa282
...@@ -552,9 +552,9 @@ func TestArtifactsGetSingleFile(t *testing.T) { ...@@ -552,9 +552,9 @@ func TestArtifactsGetSingleFile(t *testing.T) {
resourcePath := `/namespace/project/builds/123/artifacts/file/` + fileName resourcePath := `/namespace/project/builds/123/artifacts/file/` + fileName
ts := testhelper.TestServerWithHandler(regexp.MustCompile(`\A`+resourcePath+`\z`), func(w http.ResponseWriter, r *http.Request) { ts := testhelper.TestServerWithHandler(regexp.MustCompile(`\A`+resourcePath+`\z`), func(w http.ResponseWriter, r *http.Request) {
encodedFilename := base64.StdEncoding.EncodeToString([]byte(fileName)) encodedFilename := base64.StdEncoding.EncodeToString([]byte(fileName))
if _, err := fmt.Fprintf(w, `{"Archive":"%s","Entry":"%s"}`, archivePath, encodedFilename); err != nil { jsonParams := fmt.Sprintf(`{"Archive":"%s","Entry":"%s"}`, archivePath, encodedFilename)
t.Fatal(err) data := base64.URLEncoding.EncodeToString([]byte(jsonParams))
} w.Header().Set("Gitlab-Workhorse-Send-Data", "artifacts-entry:"+data)
return return
}) })
defer ts.Close() defer ts.Close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment