Commit 3c46b001 authored by Kristel Meikas's avatar Kristel Meikas
Browse files

TEIS-2113: expose content disposition header

parent 17e226ff
......@@ -20,8 +20,9 @@ import static ee.sm.ti.teis.errors.CommonErrorCode.BAD_REQUEST;
@RequiredArgsConstructor
public class ProceedingProcessingService {
public static final String CONTENT_DISPOSITION = "Content-disposition";
public static final String CONTENT_DISPOSITION = "Content-Disposition";
public static final String ATTACHMENT_FILENAME = "attachment;filename=";
public static final String ACCESS_CONTROL_EXPOSE_HEADERS = "Access-Control-Expose-Headers";
private final RabbitTemplate gwRabbitTemplate;
......@@ -31,6 +32,7 @@ public class ProceedingProcessingService {
if (response != null) {
GeneratedDocumentDto generatedDocument = response.processResponse();
if (generatedDocument != null) {
httpServletResponse.addHeader(ACCESS_CONTROL_EXPOSE_HEADERS, CONTENT_DISPOSITION);
httpServletResponse.addHeader(CONTENT_DISPOSITION, ATTACHMENT_FILENAME + generatedDocument.getDocName());
httpServletResponse.setContentType(generatedDocument.getContentType());
try (ByteArrayInputStream docStream = new ByteArrayInputStream(generatedDocument.getContent())) {
......
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