Fix service profiles quoted filename download issue (#2473) (#2479)

* Fix service profiles quoted filename download issue (#2473)
* Change the tests accordingly to fix quotes in filename

Signed-off-by: Gaurav Kumar <gaurav.kumar9825@gmail.com>
This commit is contained in:
Gaurav Kumar 2019-03-13 04:19:17 +05:30 committed by Kevin Lingerfelt
parent e5d2460792
commit e9287cc8c8
2 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@ func (h *handler) handleProfileDownload(w http.ResponseWriter, req *http.Request
return return
} }
dispositionHeaderVal := fmt.Sprintf("attachment; filename='%s-profile.yml'", service) dispositionHeaderVal := fmt.Sprintf("attachment; filename=%s-profile.yml", service)
w.Header().Set("Content-Type", "text/yaml") w.Header().Set("Content-Type", "text/yaml")
w.Header().Set("Content-Disposition", dispositionHeaderVal) w.Header().Set("Content-Disposition", dispositionHeaderVal)

View File

@ -95,7 +95,7 @@ func TestHandleConfigDownload(t *testing.T) {
"text/yaml", "text/yaml",
}, },
"Content-Disposition": []string{ "Content-Disposition": []string{
"attachment; filename='authors-profile.yml'", "attachment; filename=authors-profile.yml",
}, },
} }
if !reflect.DeepEqual(recorder.Header(), header) { if !reflect.DeepEqual(recorder.Header(), header) {