Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

注册SaInterceptor 拦截器后访问不存在的接口 导致OOM #738

Open
yanXiaoi opened this issue Feb 12, 2025 · 1 comment
Open

Comments

@yanXiaoi
Copy link

使用版本:

cn.dev33 sa-token-spring-boot3-starter 1.40.0 cn.dev33 sa-token-redisson-jackson2 1.40.0

报错信息:

java.lang.OutOfMemoryError: Java heap space

希望结果:

正常返回404,或者交由全局异常处理器处理

复现步骤:

    //拦截admin相关路由
    registry.addInterceptor(new SaInterceptor(handle -> StpUtil.checkLogin()))
            .addPathPatterns("/api/admin/**")
            .excludePathPatterns("/api/admin/login/**");

//
//拦截user相关路由
registry.addInterceptor(new SaInterceptor(handle -> StpUserUtil.checkLogin()))
.addPathPatterns("/api/user/")
.excludePathPatterns("/api/user/login/
");

注册拦截器后,访问如 /api/user/sda 等不存在的路由时直接OOM

< 备注:如果复现步骤比较复杂,请将 demo 上传到 gitee 并留下地址 >

@uncarbon97
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants