@@ -63,12 +63,13 @@ public SeePdfs(
6363 }
6464
6565 @ Override
66- protected void doGet (HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException {
66+ protected void doGet (HttpServletRequest req , HttpServletResponse resp )
67+ throws IOException , ServletException {
6768 String accessId = getAccessId (req );
6869 Path accessYaml = getAccessYaml (accessId );
6970 if (Files .notExists (accessYaml )) {
70- req .getRequestDispatcher ("/404" ).forward (req , resp );
71- return ;
71+ req .getRequestDispatcher ("/404" ).forward (req , resp );
72+ return ;
7273 }
7374 AccessRule accessRule = yaml .loadAs (new FileInputStream (accessYaml .toFile ()), AccessRule .class );
7475 if (isExpired (accessYaml )) {
@@ -147,6 +148,7 @@ private void writePdfFileResponse(
147148 reportDownload (accessRule , visitor );
148149 byte [] buffer = new byte [1024 ];
149150 resp .setContentType ("application/pdf" );
151+ resp .setHeader ("Content-Disposition" , String .format ("filename=\" %s\" " , pdfPath .getFileName ()));
150152 try (InputStream in = Files .newInputStream (pdfPath )) {
151153 OutputStream output = resp .getOutputStream ();
152154 for (int length ; (length = in .read (buffer )) > 0 ; ) {
0 commit comments