You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by "david6969xin (via GitHub)" <gi...@apache.org> on 2023/05/22 07:11:57 UTC
[GitHub] [servicecomb-java-chassis] david6969xin opened a new pull request, #3801: fix HttpUtils cannot correctly resolve file names
david6969xin opened a new pull request, #3801:
URL: https://github.com/apache/servicecomb-java-chassis/pull/3801
#3784
--
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: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] liubao68 commented on a diff in pull request #3801: [#3784]fix HttpUtils cannot correctly resolve file names
Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 commented on code in PR #3801:
URL: https://github.com/apache/servicecomb-java-chassis/pull/3801#discussion_r1200257209
##########
foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/http/HttpUtils.java:
##########
@@ -46,7 +46,7 @@ public static String parseParamFromHeaderValue(String headerValue, String paramN
}
if (paramName.equalsIgnoreCase(trimValue.substring(0, idx))) {
- return trimValue.replaceAll("\"", "").substring(idx + 1);
+ return trimValue.replaceAll("\"", "").substring(idx + 1).trim();
Review Comment:
```
for (String value : headerValue.split(";")) {
int idx = value.indexOf('=');
if (idx == -1) {
continue;
}
if (paramName.equalsIgnoreCase(value.substring(0, idx).trim())) {
return value.substring(idx + 1).trim().replaceAll("\"", "");
}
}
```
Is this better?
--
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: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] liubao68 commented on a diff in pull request #3801: [#3784]fix HttpUtils cannot correctly resolve file names
Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 commented on code in PR #3801:
URL: https://github.com/apache/servicecomb-java-chassis/pull/3801#discussion_r1200249180
##########
foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/http/HttpUtils.java:
##########
@@ -46,7 +46,7 @@ public static String parseParamFromHeaderValue(String headerValue, String paramN
}
if (paramName.equalsIgnoreCase(trimValue.substring(0, idx))) {
- return trimValue.replaceAll("\"", "").substring(idx + 1);
+ return trimValue.replaceAll("\"", "").substring(idx + 1).trim();
Review Comment:
Is it possible `a=b; a = b `
--
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: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] david6969xin commented on pull request #3801: [#3784]fix HttpUtils cannot correctly resolve file names
Posted by "david6969xin (via GitHub)" <gi...@apache.org>.
david6969xin commented on PR #3801:
URL: https://github.com/apache/servicecomb-java-chassis/pull/3801#issuecomment-1556709950
> @david6969xin test case not passed
@liubao68 ok,i will fix 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: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] liubao68 commented on pull request #3801: [#3784]fix HttpUtils cannot correctly resolve file names
Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 commented on PR #3801:
URL: https://github.com/apache/servicecomb-java-chassis/pull/3801#issuecomment-1560317027
@david6969xin would you mind to fix the review comments?
--
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: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] david6969xin commented on a diff in pull request #3801: [#3784]fix HttpUtils cannot correctly resolve file names
Posted by "david6969xin (via GitHub)" <gi...@apache.org>.
david6969xin commented on code in PR #3801:
URL: https://github.com/apache/servicecomb-java-chassis/pull/3801#discussion_r1203346279
##########
foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/http/HttpUtils.java:
##########
@@ -46,7 +46,7 @@ public static String parseParamFromHeaderValue(String headerValue, String paramN
}
if (paramName.equalsIgnoreCase(trimValue.substring(0, idx))) {
- return trimValue.replaceAll("\"", "").substring(idx + 1);
+ return trimValue.replaceAll("\"", "").substring(idx + 1).trim();
Review Comment:
sure
--
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: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] liubao68 commented on pull request #3801: [#3784]fix HttpUtils cannot correctly resolve file names
Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 commented on PR #3801:
URL: https://github.com/apache/servicecomb-java-chassis/pull/3801#issuecomment-1556674909
@david6969xin test case not passed
--
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: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] david6969xin commented on pull request #3801: [#3784]fix HttpUtils cannot correctly resolve file names
Posted by "david6969xin (via GitHub)" <gi...@apache.org>.
david6969xin commented on PR #3801:
URL: https://github.com/apache/servicecomb-java-chassis/pull/3801#issuecomment-1560395393
> @david6969xin would you mind to fix the review comments?
yes,i will fix that lately accoding to the review comments @liubao68
--
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: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] liubao68 commented on a diff in pull request #3801: [#3784]fix HttpUtils cannot correctly resolve file names
Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 commented on code in PR #3801:
URL: https://github.com/apache/servicecomb-java-chassis/pull/3801#discussion_r1200258886
##########
foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/http/TestHttpUtils.java:
##########
@@ -55,6 +55,21 @@ public void parseParamFromHeaderValue_keyNotFound() {
Assertions.assertNull(HttpUtils.parseParamFromHeaderValue("xx;k=", "kk"));
}
+ @Test
+ public void parseParamFromHeaderValue_valueWithQuotationMark() {
+ Assertions.assertEquals("v", HttpUtils.parseParamFromHeaderValue("xx;k=\"v\"", "k"));
+ }
+
+ @Test
+ public void parseParamFromHeaderValue_valueWithBlank() {
+ Assertions.assertEquals("v", HttpUtils.parseParamFromHeaderValue("xx; k=v", "k"));
+ }
+
+ @Test
+ public void parseParamFromHeaderValue_valueWithQuotationMarkAndBlank() {
+ Assertions.assertEquals("v", HttpUtils.parseParamFromHeaderValue("xx;k= \"v\"", "k"));
+ }
Review Comment:
Maybe the following cases is enough
* key1=a;key2=b
* key1=a; key2=b
* key1="a";key2="b"
* key1="a"; key2="b"
* key1="a"; key2="b c.txt"
--
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: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] liubao68 merged pull request #3801: [#3784]fix HttpUtils cannot correctly resolve file names
Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 merged PR #3801:
URL: https://github.com/apache/servicecomb-java-chassis/pull/3801
--
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: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] codecov-commenter commented on pull request #3801: [#3784]fix HttpUtils cannot correctly resolve file names
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3801:
URL: https://github.com/apache/servicecomb-java-chassis/pull/3801#issuecomment-1562134139
## [Codecov](https://app.codecov.io/gh/apache/servicecomb-java-chassis/pull/3801?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#3801](https://app.codecov.io/gh/apache/servicecomb-java-chassis/pull/3801?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (f4c444c) into [master](https://app.codecov.io/gh/apache/servicecomb-java-chassis/commit/a3c4fb8de0069d091153c732f61f732633aaef14?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (a3c4fb8) will **decrease** coverage by `0.02%`.
> The diff coverage is `50.00%`.
> :exclamation: Current head f4c444c differs from pull request most recent head 28b6041. Consider uploading reports for the commit 28b6041 to get more accurate results
```diff
@@ Coverage Diff @@
## master #3801 +/- ##
============================================
- Coverage 43.98% 43.97% -0.02%
+ Complexity 6088 6084 -4
============================================
Files 1557 1557
Lines 38278 38278
Branches 3512 3512
============================================
- Hits 16836 16832 -4
- Misses 20133 20136 +3
- Partials 1309 1310 +1
```
| [Impacted Files](https://app.codecov.io/gh/apache/servicecomb-java-chassis/pull/3801?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [.../servicecomb/foundation/common/http/HttpUtils.java](https://app.codecov.io/gh/apache/servicecomb-java-chassis/pull/3801?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm91bmRhdGlvbnMvZm91bmRhdGlvbi1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2ZvdW5kYXRpb24vY29tbW9uL2h0dHAvSHR0cFV0aWxzLmphdmE=) | `24.32% <50.00%> (ø)` | |
... and [6 files with indirect coverage changes](https://app.codecov.io/gh/apache/servicecomb-java-chassis/pull/3801/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
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: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org