You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "orpiske (via GitHub)" <gi...@apache.org> on 2023/11/30 21:37:47 UTC
[PR] CAMEL-20163: cleanup parsing HTTP status range (camel-vertx-http) [camel]
orpiske opened a new pull request, #12284:
URL: https://github.com/apache/camel/pull/12284
(no comment)
--
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@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20163: cleanup parsing HTTP status range (camel-vertx-http) [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12284:
URL: https://github.com/apache/camel/pull/12284#issuecomment-1834599673
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot.
* You can label PRs using `build-all`, `build-dependents`, `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the Summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
* :warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
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@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20163: cleanup parsing HTTP status range (camel-vertx-http) [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #12284:
URL: https://github.com/apache/camel/pull/12284#discussion_r1411626466
##########
components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpEndpoint.java:
##########
@@ -60,18 +61,23 @@ public VertxHttpComponent getComponent() {
@Override
protected void doInit() throws Exception {
String range = configuration.getOkStatusCodeRange();
+ parseStatusRange(range);
+ }
+
+ private void parseStatusRange(String range) {
if (!range.contains(",")) {
- // default is 200-299 so lets optimize for this
- if (range.contains("-")) {
- minOkRange = Integer.parseInt(StringHelper.before(range, "-"));
- maxOkRange = Integer.parseInt(StringHelper.after(range, "-"));
- } else {
+ if (!HttpUtil.parseStatusRange(range, this::setRanges)) {
minOkRange = Integer.parseInt(range);
maxOkRange = minOkRange;
}
}
}
+ private void setRanges(int minOkRange, int maxOkRange) {
Review Comment:
Is this method in use ?
--
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@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20163: cleanup parsing HTTP status range (camel-vertx-http) [camel]
Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on code in PR #12284:
URL: https://github.com/apache/camel/pull/12284#discussion_r1411901394
##########
components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpEndpoint.java:
##########
@@ -60,18 +61,23 @@ public VertxHttpComponent getComponent() {
@Override
protected void doInit() throws Exception {
String range = configuration.getOkStatusCodeRange();
+ parseStatusRange(range);
+ }
+
+ private void parseStatusRange(String range) {
if (!range.contains(",")) {
- // default is 200-299 so lets optimize for this
- if (range.contains("-")) {
- minOkRange = Integer.parseInt(StringHelper.before(range, "-"));
- maxOkRange = Integer.parseInt(StringHelper.after(range, "-"));
- } else {
+ if (!HttpUtil.parseStatusRange(range, this::setRanges)) {
minOkRange = Integer.parseInt(range);
maxOkRange = minOkRange;
}
}
}
+ private void setRanges(int minOkRange, int maxOkRange) {
Review Comment:
Yes it is. It's referenced on line 69, by the `parseStatusRange`.
--
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@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20163: cleanup parsing HTTP status range (camel-vertx-http) [camel]
Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske merged PR #12284:
URL: https://github.com/apache/camel/pull/12284
--
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@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org