Skip to content

Conversation

shahabkondri
Copy link

@shahabkondri shahabkondri commented Jun 25, 2025

Motivation

StaticResourceLocation handles common static assets (CSS, JS, IMAGES, …) but omits web-fonts.
As a result, PathRequest.toStaticResources() does not match /fonts/**, forcing users to add custom ant matchers.
Adding a dedicated FONTS location ("/fonts/**") removes that gap.

Implementation

  • New enum constant FONTS("/fonts/**") in StaticResourceLocation.
    No breaking changes; existing constants keep the same semantics.

Tests

  • Unit test verifies that StaticResourceLocation now matches a /fonts/font.woff2 request.

@shahabkondri shahabkondri force-pushed the add-fonts-static-resource branch from c0a0954 to 5804658 Compare June 25, 2025 17:31
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 25, 2025
@shahabkondri shahabkondri changed the title Add FONTS location to StaticResourceLocation Add FONTS location to StaticResourceLocation Jun 25, 2025
@shahabkondri shahabkondri force-pushed the add-fonts-static-resource branch from 5804658 to 67ecb4e Compare June 25, 2025 17:51
@philwebb philwebb added the for: team-meeting An issue we'd like to discuss as a team to make progress label Jun 25, 2025
@shahabkondri shahabkondri force-pushed the add-fonts-static-resource branch from 67ecb4e to e1692a9 Compare July 4, 2025 11:44
@philwebb philwebb added type: enhancement A general enhancement status: noteworthy A noteworthy issue to call out in the release notes and removed status: waiting-for-triage An issue we've not yet triaged for: team-meeting An issue we'd like to discuss as a team to make progress labels Jul 23, 2025
@philwebb philwebb added this to the 4.0.x milestone Jul 23, 2025
@snicoll snicoll added the for: team-meeting An issue we'd like to discuss as a team to make progress label Sep 30, 2025
@wilkinsona
Copy link
Member

We discussed this again today. The issue is noteworthy as we want to call out that this change will affect access to /fonts/** for anyone using atCommonLocations() on StaticResourceRequestMatcher.

@wilkinsona wilkinsona removed the for: team-meeting An issue we'd like to discuss as a team to make progress label Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: noteworthy A noteworthy issue to call out in the release notes type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants