From 88df655eb149877ed989dbabc4bac1874738a260 Mon Sep 17 00:00:00 2001
From: Imran M Yousuf <imyousuf@smartitengineering.com>
Date: Mon, 23 Mar 2009 21:46:33 +0600
Subject: [PATCH] Fix Date to String conversion in Content-Disposition string generation

According to RFC 2183 the date strings are to be quoted strings, but this
was not respected by ContentDisposition.toString(), thus the following use
would generate an ParseException -
new ContentDisposition(someValidContentDisposition.toString())

This fix simply quotes the date string.

Signed-off-by: Imran M Yousuf <imyousuf@smartitengineering.com>
---
 .../sun/jersey/core/header/ContentDisposition.java |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/jersey-core/src/main/java/com/sun/jersey/core/header/ContentDisposition.java b/jersey-core/src/main/java/com/sun/jersey/core/header/ContentDisposition.java
index 1871898..d87bd11 100644
--- a/jersey-core/src/main/java/com/sun/jersey/core/header/ContentDisposition.java
+++ b/jersey-core/src/main/java/com/sun/jersey/core/header/ContentDisposition.java
@@ -186,7 +186,7 @@ public class ContentDisposition {
 
     protected void addDateParameter(StringBuilder sb, String name, Date p) {
         if (p != null)
-            sb.append(';').append(name).append('=').append(HttpDateFormat.getPreferedDateFormat().format(p));
+            sb.append(';').append(name).append("=\"").append(HttpDateFormat.getPreferedDateFormat().format(p)).append("\"");
     }
 
     protected void addLongParameter(StringBuilder sb, String name, Long p) {
-- 
1.5.6