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

feature: URL prefix case-sensitive #1637

Merged
merged 3 commits into from
Apr 25, 2021
Merged

feature: URL prefix case-sensitive #1637

merged 3 commits into from
Apr 25, 2021

Conversation

GLYASAI
Copy link
Contributor

@GLYASAI GLYASAI commented Apr 23, 2021

Issues associated with this PR

#1633

Solutions

make the configuration 'case_sensitive' work.

@taoyuanyuan taoyuanyuan changed the title bug fix: URL prefix case-sensitive feature: URL prefix case-sensitive Apr 23, 2021
@codecov
Copy link

codecov bot commented Apr 23, 2021

Codecov Report

Merging #1637 (1e947a8) into master (1f5e44a) will increase coverage by 0.18%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1637      +/-   ##
==========================================
+ Coverage   59.22%   59.41%   +0.18%     
==========================================
  Files         369      369              
  Lines       28665    28669       +4     
==========================================
+ Hits        16978    17034      +56     
+ Misses       9760     9714      -46     
+ Partials     1927     1921       -6     
Impacted Files Coverage Δ
pkg/filter/stream/jwtauthn/matcher.go 88.37% <100.00%> (+1.19%) ⬆️
pkg/xds/v2/xdsconfig.go 25.96% <0.00%> (+1.10%) ⬆️
pkg/filter/network/grpc/factory.go 65.21% <0.00%> (+2.89%) ⬆️
pkg/upstream/servicediscovery/dubbod/bootstrap.go 64.28% <0.00%> (+4.76%) ⬆️
...ream/faulttolerance/regulator/default_work_pool.go 91.42% <0.00%> (+5.71%) ⬆️
pkg/xds/v2/cdssubscriber.go 26.08% <0.00%> (+8.69%) ⬆️
pkg/filter/network/grpc/conn.go 55.73% <0.00%> (+11.47%) ⬆️
pkg/filter/network/grpc/listener.go 81.81% <0.00%> (+18.18%) ⬆️
pkg/xds/v2/adssubscriber.go 42.66% <0.00%> (+41.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f5e44a...1e947a8. Read the comment docs.

@taoyuanyuan taoyuanyuan requested review from antJack and nejisama April 23, 2021 03:53
@nejisama nejisama added this to the 0.23.0 milestone Apr 23, 2021
antJack
antJack previously approved these changes Apr 25, 2021
Copy link
Contributor

@antJack antJack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -69,7 +70,11 @@ func newPrefixMatcher(rule *jwtauthnv3.RequirementRule) Matcher {
}

func (p *prefixMatcher) Matches(headers api.HeaderMap, requestPath string) bool {
if p.baseMatcher.matchRoutes(headers, requestPath) && strings.HasPrefix(requestPath, p.prefix) {
prefixMatch := strings.HasPrefix(requestPath, p.prefix)
if !p.baseMatcher.caseSensitive {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是不是有重复计算。 先判断caseSensitive?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor

@antJack antJack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

3 participants