alibaba / alibaba/Sentinel

一点关于UrlCleaner的改进建议和意见

Open
#1,287 4 comments 0 reactions 0 assignees View on GitHub
area/integrations good first issue kind/enhancement
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

这里,UrlCleaner特指sentinel-spring-webmvc-adapter中的UrlCleaner:
https://github.com/alibaba/Sentinel/blob/master/sentinel-adapter/sentinel-spring-webmvc-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/spring/webmvc/callback/UrlCleaner.java

个人认为有两点值得改进:

* UrlCleaner名称词不达意。UrlCleaner重写的不是Url,而是资源名称,叫ResourceNameRewiter或许更加贴切。

* 目前UrlCleaner提供的参数较少,能定制的空间很小。目前只能在原资源名称的基础上改写资源。但实际业务中,往往需要根据具体的请求重写资源名称。因此,加上 `HttpServletRequest` 的参数灵活性会好很多。

Contributor guide

Open the contributing guide

Research direction

Start with sentinel-adapter/sentinel-spring-webmvc-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/spring/webmvc/callback/UrlCleaner.java and inspect its callers and public callback usage. Evaluate the proposed resource-name rename and HttpServletRequest parameter, including compatibility implications; done means the API supports request-based rewriting and the naming accurately reflects its purpose.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.