You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by zh...@apache.org on 2010/08/06 00:50:49 UTC
svn commit: r982818 -
/shindig/trunk/java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java
Author: zhoresh
Date: Thu Aug 5 22:50:48 2010
New Revision: 982818
URL: http://svn.apache.org/viewvc?rev=982818&view=rev
Log:
Update instead of add "Date" header in HttpResponse
http://codereview.appspot.com/1888045/show
Modified:
shindig/trunk/java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java
Modified: shindig/trunk/java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java?rev=982818&r1=982817&r2=982818&view=diff
==============================================================================
--- shindig/trunk/java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java (original)
+++ shindig/trunk/java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java Thu Aug 5 22:50:48 2010
@@ -35,7 +35,7 @@ import java.util.regex.Pattern;
*/
public final class HttpUtil {
private HttpUtil() {}
-
+
// 1 year.
private static int defaultTtl = 60 * 60 * 24 * 365;
@@ -49,6 +49,10 @@ public final class HttpUtil {
HttpUtil.timeSource = timeSource;
}
+ public static TimeSource getTimeSource() {
+ return timeSource;
+ }
+
/**
* Sets HTTP headers that instruct the browser to cache content. Implementations should take care
* to use cache-busting techniques on the url if caching for a long period of time.
@@ -81,7 +85,7 @@ public final class HttpUtil {
public static void setCachingHeaders(HttpServletResponse response, int ttl) {
setCachingHeaders(response, ttl, false);
}
-
+
public static void setNoCache(HttpServletResponse response) {
setCachingHeaders(response, 0, false);
}
@@ -137,7 +141,7 @@ public final class HttpUtil {
// Must be a GET
if (!"GET".equals(request.getMethod()))
return false;
-
+
// No callback specified
if (callback == null) return false;