Skip to content
Snippets Groups Projects
Commit 5138f629 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

issue fixed when wodnloading file that didn't had a file defined

parent 78e9daef
No related branches found
No related tags found
1 merge request!289Resolve "admin should be able to list all overlays"
Pipeline #
......@@ -144,12 +144,16 @@ public class OverlayController extends BaseController {
FileEntry file = overlayRestImp.getOverlaySource(token, projectId, overlayId);
MediaType type = MediaType.TEXT_PLAIN;
if (file.getOriginalFileName().endsWith("xml")) {
type = MediaType.APPLICATION_XML;
String filename = file.getOriginalFileName();
if (filename != null) {
if (file.getOriginalFileName().endsWith("xml")) {
type = MediaType.APPLICATION_XML;
}
} else {
filename = overlayId + ".txt";
}
return ResponseEntity.ok().contentLength(file.getFileContent().length).contentType(type)
.header("Content-Disposition", "attachment; filename=" + file.getOriginalFileName())
.body(file.getFileContent());
.header("Content-Disposition", "attachment; filename=" + filename).body(file.getFileContent());
}
/**
......
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