You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2020/04/11 18:05:41 UTC

[myfaces] branch master updated: fix: Incorrect Last-Modified header for resources

This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/master by this push:
     new 5e9976d  fix: Incorrect Last-Modified header for resources
     new 50c0257  Merge pull request #94 from astappiev/patch-2
5e9976d is described below

commit 5e9976d8f5e028b9e7aafeb12acb243f274da2d7
Author: Oleh Astappiev <as...@l3s.de>
AuthorDate: Sat Apr 11 19:56:47 2020 +0200

    fix: Incorrect Last-Modified header for resources
---
 .../org/apache/myfaces/resource/ResourceLoaderUtils.java   | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/resource/ResourceLoaderUtils.java b/impl/src/main/java/org/apache/myfaces/resource/ResourceLoaderUtils.java
index a1e6456..c70286d 100644
--- a/impl/src/main/java/org/apache/myfaces/resource/ResourceLoaderUtils.java
+++ b/impl/src/main/java/org/apache/myfaces/resource/ResourceLoaderUtils.java
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.resource;
 
-import java.io.File;
 import java.io.IOException;
 import java.net.JarURLConnection;
 import java.net.URL;
@@ -67,18 +66,7 @@ public class ResourceLoaderUtils
 
     public static long getResourceLastModified(URL url) throws IOException
     {
-        if ("file".equals(url.getProtocol()))
-        {
-            String externalForm = url.toExternalForm();
-            // Remove the "file:"
-            File file = new File(externalForm.substring(5));
-
-            return file.lastModified();
-        }
-        else
-        {
-            return getResourceLastModified(url.openConnection());
-        }
+        return getResourceLastModified(url.openConnection());
     }
 
     public static long getResourceLastModified(URLConnection connection) throws IOException