Skip to content

fix: match literal path-extension downloads with trailing slash#24537

Merged
jason-p-pickering merged 1 commit into
masterfrom
fix/path-extension-trailing-slash-fallback
Jul 23, 2026
Merged

fix: match literal path-extension downloads with trailing slash#24537
jason-p-pickering merged 1 commit into
masterfrom
fix/path-extension-trailing-slash-fallback

Conversation

@netroms

@netroms netroms commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Why this surfaced

Doris analytics PR run still had 1 failure after #24479:
AnalyticsAggregateDownloadTest.queryWithXlsxDownloadGET /api/analytics.xlsx/ → 406.

RestAssured basePath("analytics.xlsx") + get("") produces the trailing slash. Other download tests put the suffix in the resource id and never hit this path shape.

Lookup order now

For /api/analytics.xlsx/:

  1. fully stripped → /api/analytics (+ forced xlsx media type)
  2. slash-only stripped → /api/analytics.xlsx ← new
  3. original → /api/analytics.xlsx/
  4. rethrow 406 only if no fallback mapping exists

Test plan

  • mvn -pl dhis-web-api -Dtest=CustomRequestMappingHandlerMappingNormalizeTest test
  • analytics e2e download tests / Doris analytics job once merged or on a PR that runs them

Follow-up to #24479. Paths like /api/analytics.xlsx/ fully strip to
/api/analytics, hit the JSON produces handler (406), then failed the
literal fallback because the original URI still had the trailing slash
and Spring 7 does not trailing-slash-match.

Retry with only the trailing slash removed before the raw original path
so literal download mappings still win. Covers the RestAssured basePath
pattern used by AnalyticsAggregateDownloadTest.
@sonarqubecloud

sonarqubecloud Bot commented Jul 23, 2026

Copy link
Copy Markdown

@jason-p-pickering
jason-p-pickering self-requested a review July 23, 2026 12:26
@jason-p-pickering
jason-p-pickering merged commit fc846bf into master Jul 23, 2026
25 checks passed
@jason-p-pickering
jason-p-pickering deleted the fix/path-extension-trailing-slash-fallback branch July 23, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants