Skip to content
Snippets Groups Projects
Commit 8b151069 authored by Dean's avatar Dean
Browse files

fix content-type in /upload/simple

parent 93ca4401
No related branches found
No related tags found
No related merge requests found
......@@ -350,11 +350,9 @@ func UploadPomf(associateObjectsWithUser bool, simpleResponse bool) func(http.Re
}
// Return response
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(statusCode)
// Simple response
if simpleResponse {
w.Header().Set("Content-Type", "text/plain")
w.WriteHeader(statusCode)
for _, fResponse := range fileResponses {
if fResponse.Success {
w.Write([]byte(fmt.Sprintf("%s,200\n", fResponse.URL)))
......@@ -363,6 +361,8 @@ func UploadPomf(associateObjectsWithUser bool, simpleResponse bool) func(http.Re
}
}
} else {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(statusCode)
render.JSON(w, r, fullResponse{Success: true, Files: fileResponses})
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment