Author: Jogy
Date: 2006-12-19 20:35:35 +0000 (Tue, 19 Dec 2006)
New Revision: 11493
Modified:
trunk/freenet/src/freenet/clients/http/ToadletContextImpl.java
Log:
Force the localization "SimpleDateFormat" to Locale.US. Otherwise it would lead
to localized (and therefore corrupt) date: and last-modified: HTTP-Header
fields. wget moaned about it and it should be fixed anyway.
Checked the code for other "SimpleDateformat"s, there are some but they don't
use written names for months, etc. They are left untouched. Watch out :)
Modified: trunk/freenet/src/freenet/clients/http/ToadletContextImpl.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ToadletContextImpl.java
2006-12-19 19:47:33 UTC (rev 11492)
+++ trunk/freenet/src/freenet/clients/http/ToadletContextImpl.java
2006-12-19 20:35:35 UTC (rev 11493)
@@ -11,6 +11,7 @@
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Enumeration;
+import java.util.Locale;
import java.util.TimeZone;
import freenet.support.HTMLEncoder;
@@ -156,7 +157,7 @@
private static String makeHTTPDate(long time) {
// For HTTP, GMT == UTC
- SimpleDateFormat sdf = new SimpleDateFormat("EEE, dd MMM yyyy
HH:mm:ss 'GMT'");
+ SimpleDateFormat sdf = new SimpleDateFormat("EEE, dd MMM yyyy
HH:mm:ss 'GMT'",Locale.US);
sdf.setTimeZone(TZ_UTC);
return sdf.format(new Date(time));
}