You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Xzhhhhhh (via GitHub)" <gi...@apache.org> on 2023/08/16 16:10:02 UTC
[GitHub] [dubbo] Xzhhhhhh opened a new pull request, #12921: fix PathMatcher hashcode method does not consider method field
Xzhhhhhh opened a new pull request, #12921:
URL: https://github.com/apache/dubbo/pull/12921
## What is the purpose of the change
fix PathMatcher hashcode method does not consider method field
#12907
## Brief changelog
## Verifying this change
<!-- Follow this checklist to help us incorporate your contribution quickly and easily: -->
## Checklist
- [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
- [ ] Each commit in the pull request should have a meaningful subject line and body.
- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
- [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in [dubbo samples](https://github.com/apache/dubbo-samples) project.
- [ ] Add some description to [dubbo-website](https://github.com/apache/dubbo-website) project if you are requesting to add a feature.
- [ ] GitHub Actions works fine on your own branch.
- [ ] If this contribution is large, please follow the [Software Donation Guide](https://github.com/apache/dubbo/wiki/Software-donation-guide).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] NingleXu closed pull request #12921: modify the judgment logic of httpMethodMatch
Posted by "NingleXu (via GitHub)" <gi...@apache.org>.
NingleXu closed pull request #12921: modify the judgment logic of httpMethodMatch
URL: https://github.com/apache/dubbo/pull/12921
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] AlbumenJ commented on pull request #12921: modify the judgment logic of httpMethodMatch
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on PR #12921:
URL: https://github.com/apache/dubbo/pull/12921#issuecomment-1691084183

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] Xzhhhhhh commented on pull request #12921: modify the judgment logic of httpMethodMatch
Posted by "Xzhhhhhh (via GitHub)" <gi...@apache.org>.
Xzhhhhhh commented on PR #12921:
URL: https://github.com/apache/dubbo/pull/12921#issuecomment-1687591537
Fixing #12890 also fixes #12907 , so I changed the comment on httpMethodMatch and added some unit tests to verify it in my pr. @suncairong163
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #12921: modify the judgment logic of httpMethodMatch
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on code in PR #12921:
URL: https://github.com/apache/dubbo/pull/12921#discussion_r1305235401
##########
dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/rest/PathMatcher.java:
##########
@@ -174,7 +174,7 @@ && httpMethodMatch(that) // http method compare
}
/**
- * it is needed to compare http method when one of needCompareHttpMethod is true,and don`t compare when both needCompareHttpMethod are false
+ * needCompareHttpMethod is not compared when one of them is false, and needCompareHttpMethod is compared when both are true
Review Comment:
Is there any **real** changes?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] AlbumenJ commented on pull request #12921: modify the judgment logic of httpMethodMatch
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on PR #12921:
URL: https://github.com/apache/dubbo/pull/12921#issuecomment-1685918643
@suncairong163 PTAL
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] Xzhhhhhh commented on pull request #12921: modify the judgment logic of httpMethodMatch
Posted by "Xzhhhhhh (via GitHub)" <gi...@apache.org>.
Xzhhhhhh commented on PR #12921:
URL: https://github.com/apache/dubbo/pull/12921#issuecomment-1686778447
@suncairong163
我在阅读这段代码时,发现它似乎与注释说明的效果不符。1. fasle的情况下,它能做到不比较httpMethod 2. 都是true的情况下,它能做到比较httpMethod 3. 一个true,一个false的情况下它就不会去httpMethod,这样会导致很多地方有错误。

我提pr之前 #12890 提交的代码还未 `mr,我现在发现你提交此次代码后,我目前这个issues已经得到了解决。主要得益于这段代码

在获取restMethodMetadataPair时将 RestRPCInvocationUtil.createPathMatcher(request);获取的pathMatcher的compareHttpMethod字段设置为了true。这样在你原有的httpMethodMatch逻辑中,就可以获取到比较httpMethod之后的结果了。从而避免了一个为true一个为false的情况。但是在执行它之前,有404 405 的判断,它们都是使用一个true一个false进行判断的,会出现一定问题。

比如这里是一个除了httpMethod字段不一样的几个示例,其他字段都一样的一个示例。这样只需要有一样的路径,不论httpMethod都会返回true,使得404和405的判断有误。

以上是我的一些理解,有误的地方还望多多指教。希望能给你提供帮助。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] CrazyHZM commented on pull request #12921: modify the judgment logic of httpMethodMatch
Posted by "CrazyHZM (via GitHub)" <gi...@apache.org>.
CrazyHZM commented on PR #12921:
URL: https://github.com/apache/dubbo/pull/12921#issuecomment-1687379638
@Xzhhhhhh Please fix unit test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] Xzhhhhhh closed pull request #12921: fix PathMatcher hashcode method does not consider method field
Posted by "Xzhhhhhh (via GitHub)" <gi...@apache.org>.
Xzhhhhhh closed pull request #12921: fix PathMatcher hashcode method does not consider method field
URL: https://github.com/apache/dubbo/pull/12921
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] sonarcloud[bot] commented on pull request #12921: modify the judgment logic of httpMethodMatch
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #12921:
URL: https://github.com/apache/dubbo/pull/12921#issuecomment-1691354741
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_dubbo&pullRequest=12921)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12921&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12921&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12921&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12921&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12921&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12921&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12921&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12921&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo&pullRequest=12921&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12921&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12921&resolved=false&types=CODE_SMELL) [3 Code Smells](https://sonarcloud.io/project/issues?id=apache_dubbo&pullRequest=12921&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12921&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12921&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_dubbo&pullRequest=12921&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] Xzhhhhhh commented on pull request #12921: modify the judgment logic of httpMethodMatch
Posted by "Xzhhhhhh (via GitHub)" <gi...@apache.org>.
Xzhhhhhh commented on PR #12921:
URL: https://github.com/apache/dubbo/pull/12921#issuecomment-1691274331
> 
ok, I forgot a detail, and it's been fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] Xzhhhhhh commented on pull request #12921: fix PathMatcher hashcode method does not consider method field
Posted by "Xzhhhhhh (via GitHub)" <gi...@apache.org>.
Xzhhhhhh commented on PR #12921:
URL: https://github.com/apache/dubbo/pull/12921#issuecomment-1684884198
@AlbumenJ 能帮我CR一下吗
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] Xzhhhhhh commented on pull request #12921: modify the judgment logic of httpMethodMatch
Posted by "Xzhhhhhh (via GitHub)" <gi...@apache.org>.
Xzhhhhhh commented on PR #12921:
URL: https://github.com/apache/dubbo/pull/12921#issuecomment-1687613778
> Would u pls add some uts or its to verify it?
ok, I added the unit tests and verified that the results were correct.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] Xzhhhhhh commented on pull request #12921: modify the judgment logic of httpMethodMatch
Posted by "Xzhhhhhh (via GitHub)" <gi...@apache.org>.
Xzhhhhhh commented on PR #12921:
URL: https://github.com/apache/dubbo/pull/12921#issuecomment-1687611617
> @Xzhhhhhh Please fix unit test.
ok, I added the unit tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] AlbumenJ commented on pull request #12921: modify the judgment logic of httpMethodMatch
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on PR #12921:
URL: https://github.com/apache/dubbo/pull/12921#issuecomment-1685919173
Would u pls add some uts or its to verify it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org