Commit da8970d0 authored by Joshua Priestley's avatar Joshua Priestley
Browse files

Updates headers and content disposition types for PDF and MD formats

parent 04f1d993
Pipeline #173673 passed with stages
in 5 minutes and 4 seconds
......@@ -21,7 +21,7 @@ public class MarkdownResultPage implements Page {
public void writeTo(HttpServletResponse resp) throws IOException {
File markdown = getFile();
resp.setContentType("file/markdown");
resp.setHeader("Content-Disposition", "Inline; filename=" + query + ".md");
resp.setHeader("Content-Disposition", "Attachment; filename=" + query + ".md");
outputStreams(markdown, resp);
......
......@@ -12,11 +12,11 @@ public class PDFResultPage extends MarkdownResultPage {
@Override
public void writeTo(HttpServletResponse resp) throws IOException {
resp.setContentType("file/pdf");
resp.setContentType("application/pdf");
File markdown = getFile();
resp.setHeader("Content-Disposition", "Inline; filename=" + query + ".pdf");
resp.setHeader("Content-Disposition", "Attachment; filename=" + query + ".pdf");
ProcessBuilder pb = new ProcessBuilder("pandoc", markdown.getAbsolutePath(), "-o", "result.pdf");
Process p = pb.start();
......
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