spring-projects / spring-projects/spring-boot

Allow changing mappings of auto-configured Servlet filters

Open
#31,237 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement
Dominant language
Java
Stars
81.5k
Forks
42.7k
Avg merge
2d 4h
Merged PRs (30d)
65

Description

Spring Boot auto-configures several Servlet filters (various Spring MVC related filters, Spring Security, and so on) an maps them to /** (see AbstractFilterRegistrationBean#DEFAULT_URL_MAPPINGS) but to my knowledge doesn't allow to customize the mappings.

In one recent project we wanted to add an additional Servlet to handle some specific requests, but didn't want to have all the auto-configured filters applied to it. This was a challenge because apparently there's no easy way to change the mappings of auto-configured filters.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading AbstractFilterRegistrationBean#DEFAULT_URL_MAPPINGS and tracing how Spring Boot auto-configures the Servlet filters mentioned in the issue. Define the customization point needed to change their mappings, then verify that an additional Servlet can avoid selected auto-configured filters without affecting existing defaults.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.