Skip to content

UrlHandlerFilter should not strip the trailing slash from root URLs #33444

@ghillert

Description

@ghillert

Affects: 6.2.0-M7

Issue #31366 added the new UrlHandlerFilter. That filter should handle root URLs differently by default and not strip the trailing slash from a root URL. It seem reasonable to have a blanket UrlHandlerFilter such as the following in your Spring application:

UrlHandlerFilter.trailingSlashHandler("/**").redirect(HttpStatus.PERMANENT_REDIRECT).build();

For example, a URL such as http://example.com/ is invalid without a trailing slash and browsers (or CURL) do in fact send a trailing slash if you do not specify it for root URLs.

See also: https://webmasters.stackexchange.com/questions/35643/is-trailing-slash-automagically-added-on-click-of-home-page-url-in-browser

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions