diff src/org/eclipse/jetty/server/handler/ResourceHandler.java @ 827:f89abbfb3a8f

remove Resource.getWeakETag()
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 15 Sep 2016 16:21:56 -0600
parents 0048a843297a
children 688c39c50ee3
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/handler/ResourceHandler.java	Wed Sep 14 18:51:34 2016 -0600
+++ b/src/org/eclipse/jetty/server/handler/ResourceHandler.java	Thu Sep 15 16:21:56 2016 -0600
@@ -69,7 +69,6 @@
 	ByteArrayBuffer _cacheControl;
 	boolean _aliases;
 	boolean _directory;
-	boolean _etags;
 
 	/* ------------------------------------------------------------ */
 	public ResourceHandler()
@@ -130,24 +129,6 @@
 	}
 
 	/* ------------------------------------------------------------ */
-	/**
-	 * @return True if ETag processing is done
-	 */
-	public boolean isEtags()
-	{
-		return _etags;
-	}
-
-	/* ------------------------------------------------------------ */
-	/**
-	 * @param etags True if ETag processing is done
-	 */
-	public void setEtags(boolean etags)
-	{
-		_etags = etags;
-	}
-
-	/* ------------------------------------------------------------ */
 	@Override
 	public void doStart()
 	throws Exception
@@ -438,21 +419,6 @@
 
 		// set some headers
 		long last_modified=resource.lastModified();
-		String etag=null;
-		if (_etags)
-		{
-			// simple handling of only a single etag
-			String ifnm = request.getHeader(HttpHeaders.IF_NONE_MATCH);
-			etag=resource.getWeakETag();
-			if (ifnm!=null && resource!=null && ifnm.equals(etag))
-			{
-				response.setStatus(HttpStatus.NOT_MODIFIED_304);
-				baseRequest.getResponse().getHttpFields().put(HttpHeaders.ETAG_BUFFER,etag);
-				return;
-			}
-		}
-		
-		
 		if (last_modified>0)
 		{
 			long if_modified=request.getDateHeader(HttpHeaders.IF_MODIFIED_SINCE);
@@ -470,8 +436,6 @@
 		// set the headers
 		doResponseHeaders(response,resource,mime!=null?mime.toString():null);
 		response.setDateHeader(HttpHeaders.LAST_MODIFIED,last_modified);
-		if (_etags)
-			baseRequest.getResponse().getHttpFields().put(HttpHeaders.ETAG_BUFFER,etag);
 		
 		if(skipContentBody)
 			return;