You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by th...@apache.org on 2021/02/28 13:13:03 UTC

[tapestry-5] branch 5.6.x updated: TAP5-2663: ChecksumPath should ignore slashes at the end of URLs

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

thiagohp pushed a commit to branch 5.6.x
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git


The following commit(s) were added to refs/heads/5.6.x by this push:
     new 2089b0d  TAP5-2663: ChecksumPath should ignore slashes at the end of URLs
2089b0d is described below

commit 2089b0d52b9f9158a1d20ca95d98d88037cede61
Author: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
AuthorDate: Sun Feb 28 10:12:51 2021 -0300

    TAP5-2663: ChecksumPath should ignore slashes at the end of URLs
---
 .../tapestry5/internal/services/assets/ChecksumPath.java       | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/ChecksumPath.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/ChecksumPath.java
index 03cdcae..fef200c 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/ChecksumPath.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/ChecksumPath.java
@@ -43,8 +43,16 @@ public class ChecksumPath
         checksum = extraPath.substring(0, slashx);
 
         String morePath = extraPath.substring(slashx + 1);
+        
+        // Slashes at the end of the path should be dropped because
+        // they don't make sense. TAP5-2663
+        while (morePath.endsWith("/")) 
+        {
+            morePath = morePath.substring(0, morePath.length() - 1);
+        }
 
-        if (!isBlank(morePath)) {
+        if (!isBlank(morePath)) 
+        {
             resourcePath = baseFolder == null
                     ? morePath
                     : baseFolder + "/" + morePath;