File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed
api/src/main/java/io/sentrius/sso/config Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ package io .sentrius .sso .config ;
2+
3+ import jakarta .servlet .http .HttpServletRequest ;
4+ import jakarta .servlet .http .HttpServletResponse ;
5+ import org .springframework .context .annotation .Bean ;
6+ import org .springframework .context .annotation .Configuration ;
7+ import org .springframework .stereotype .Component ;
8+ import org .springframework .web .servlet .HandlerInterceptor ;
9+ import org .springframework .web .servlet .config .annotation .ResourceHandlerRegistry ;
10+ import org .springframework .web .servlet .config .annotation .WebMvcConfigurer ;
11+
12+ @ Component
13+ public class SourceMapInterceptor implements HandlerInterceptor {
14+
15+ @ Override
16+ public boolean preHandle (
17+ HttpServletRequest request ,
18+ HttpServletResponse response ,
19+ Object handler ) throws Exception {
20+
21+ if (request .getRequestURI ().endsWith (".map" )) {
22+ response .setStatus (HttpServletResponse .SC_NO_CONTENT ); // 204
23+ return false ;
24+ }
25+ return true ;
26+ }
27+ }
Original file line number Diff line number Diff line change 1+ package io .sentrius .sso .config ;
2+
3+ import org .springframework .context .annotation .Configuration ;
4+ import org .springframework .web .servlet .config .annotation .InterceptorRegistry ;
5+ import org .springframework .web .servlet .config .annotation .WebMvcConfigurer ;
6+
7+ @ Configuration
8+ public class WebConfig implements WebMvcConfigurer {
9+
10+ private final SourceMapInterceptor interceptor ;
11+
12+ public WebConfig (SourceMapInterceptor interceptor ) {
13+ this .interceptor = interceptor ;
14+ }
15+
16+ @ Override
17+ public void addInterceptors (InterceptorRegistry registry ) {
18+ registry .addInterceptor (interceptor )
19+ .addPathPatterns ("/**" );
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments