[
https://issues.apache.org/jira/browse/WW-5645?focusedWorklogId=1030023&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1030023
]
ASF GitHub Bot logged work on WW-5645:
--------------------------------------
Author: ASF GitHub Bot
Created on: 13/Jul/26 08:31
Start Date: 13/Jul/26 08:31
Worklog Time Spent: 10m
Work Description: arunmanni-ai commented on PR #1777:
URL: https://github.com/apache/struts/pull/1777#issuecomment-4955981650
Makes sense, thanks for the detailed walkthrough. Went with option 1 —
removed both tests since the end-to-end 404 via
`webJarEncodedTraversalReturns404` already covers it. CI should be clean now.
Issue Time Tracking
-------------------
Worklog Id: (was: 1030023)
Time Spent: 1.5h (was: 1h 20m)
> Canonicalise static content paths and remove redundant URL decode
> -----------------------------------------------------------------
>
> Key: WW-5645
> URL: https://issues.apache.org/jira/browse/WW-5645
> Project: Struts 2
> Issue Type: Improvement
> Components: Core
> Affects Versions: 7.2.1
> Reporter: Arun Manni
> Priority: Minor
> Fix For: 7.3.0
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> buildPath() in DefaultStaticContentLoader applies URLDecoder.decode() to
> resource paths that the servlet container has already decoded. This redundant
> decode serves no purpose and conflicts with the servlet spec's path handling
> contract.
> This patch removes the unnecessary decode and the now-unused encoding
> field/setter, adds a Validator.canonicalisePath() utility that normalises the
> path (resolves . and .., converts \ to /) and returns Optional.empty() when
> the resolved path escapes above root, wires the canonical path through both
> findStaticResource() and the WebJar split() so downstream lookups use the
> normalised form, documents the encoding contract on
> RequestUtils.getServletPath(), and adds test coverage.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)