Update of /var/cvs/src/org/mmbase/servlet
In directory james.mmbase.org:/tmp/cvs-serv23299

Modified Files:
      Tag: MMBase-1_8
        HandleServlet.java 
Log Message:
Support for 'Content-Disposition' builder property.
ported from 1.9 because security reasons flash 10
see also: 
http://www.adobe.com/devnet/flashplayer/articles/fplayer10_security_changes_print.html#head32



See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/servlet


Index: HandleServlet.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/servlet/Attic/HandleServlet.java,v
retrieving revision 1.29.2.1
retrieving revision 1.29.2.2
diff -u -b -r1.29.2.1 -r1.29.2.2
--- HandleServlet.java  14 Mar 2007 15:17:59 -0000      1.29.2.1
+++ HandleServlet.java  25 Nov 2008 09:01:06 -0000      1.29.2.2
@@ -27,7 +27,7 @@
  * specialized servlets. The mime-type is always application/x-binary, forcing 
the browser to
  * download.
  *
- * @version $Id: HandleServlet.java,v 1.29.2.1 2007/03/14 15:17:59 nklasens 
Exp $
+ * @version $Id: HandleServlet.java,v 1.29.2.2 2008/11/25 09:01:06 sdeboer Exp 
$
  * @author Michiel Meeuwissen
  * @since  MMBase-1.6
  * @see ImageServlet
@@ -131,17 +131,24 @@
     }
 
     /**
-     * Sets the content disposition header.
-     * @return true on success
+     [EMAIL PROTECTED] MMBase-1.8.8
      */
-    protected boolean setContent(QueryParts query, Node node, String mimeType) 
throws IOException {
-        String disposition;
+    protected String getContentDisposition(QueryParts query, Node node, String 
def) {
         String fileNamePart = query.getFileName();
         if(fileNamePart != null && fileNamePart.startsWith("/inline/")) {
-            disposition = "inline";
+            return "inline";
         } else {
-            disposition = "attachment";
+            String cd = 
node.getNodeManager().getProperty("Content-Disposition");
+            return cd == null ? def : cd;
         }
+    }
+
+    /**
+     * Sets the content disposition header.
+     * @return true on success
+     */
+    protected boolean setContent(QueryParts query, Node node, String mimeType) 
throws IOException {
+        String disposition = getContentDisposition(query, node, "attachment");
         query.getResponse().setHeader("Content-Disposition", disposition + "; 
filename=\""  + getFileName(node, null, "mmbase-attachment")+ "\"");
         //res.setHeader("X-MMBase-1", "Not sending Content-Disposition because 
this might confuse Microsoft Internet Explorer");
         return true;
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to