Skip to content

Static page configured request, or will be blocked #17502

@pengliang56

Description

@pengliang56

My current environment : spring-boot 2.1.6

My test code :
first : I created two html, login.html, page.html in the static folder.

public class UserInterceptor extends HandlerInterceptorAdapter {
  @Override
  public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
      throws Exception {
    System.out.println("Interceptor: " + request.getServletPath());
    return true;
  }
}
@Configuration
public class WebSecurityConfig extends WebMvcConfigurationSupport {

  @Override
  public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(new UserInterceptor())
        .addPathPatterns("/**")
        .excludePathPatterns("/login.html");
  }
}

interview http://localhost:8080/login.html

But will be intercepted,
Why is the rule configured? It will still be blocked

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions