[GitHub] [httpcomponents-client] dependabot[bot] opened a new pull request, #410: Bump mockito-core from 4.8.1 to 5.1.1

2023-02-03 Thread via GitHub


dependabot[bot] opened a new pull request, #410:
URL: https://github.com/apache/httpcomponents-client/pull/410

   Bumps [mockito-core](https://github.com/mockito/mockito) from 4.8.1 to 5.1.1.
   
   Release notes
   Sourced from https://github.com/mockito/mockito/releases";>mockito-core's 
releases.
   
   v5.1.1
   Changelog generated 
by https://github.com/shipkit/shipkit-changelog";>Shipkit Changelog 
Gradle Plugin
   5.1.1
   
   2023-01-30 - https://github.com/mockito/mockito/compare/v5.1.0...v5.1.1";>1 
commit(s) by Andriy Redko
   StackWalker.Option not found on Mockito 5.1.0 [(https://github-redirect.dependabot.com/mockito/mockito/issues/2891";>#2891)](https://github-redirect.dependabot.com/mockito/mockito/pull/2891";>mockito/mockito#2891)
   StackWalker.Option not found on Mockito 5.1.0 [(https://github-redirect.dependabot.com/mockito/mockito/issues/2890";>#2890)](https://github-redirect.dependabot.com/mockito/mockito/issues/2890";>mockito/mockito#2890)
   
   v5.1.0
   Changelog generated 
by https://github.com/shipkit/shipkit-changelog";>Shipkit Changelog 
Gradle Plugin
   5.1.0
   
   2023-01-29 - https://github.com/mockito/mockito/compare/v5.0.0...v5.1.0";>12 
commit(s) by Andriy Redko, Ashley, Róbert Papp, Stephan Schroevers, Tim te 
Beek, dependabot[bot]
   Fixes some mistakes and missing details in documentation [(https://github-redirect.dependabot.com/mockito/mockito/issues/2889";>#2889)](https://github-redirect.dependabot.com/mockito/mockito/pull/2889";>mockito/mockito#2889)
   Bump com.diffplug.spotless from 6.13.0 to 6.14.0 [(https://github-redirect.dependabot.com/mockito/mockito/issues/2888";>#2888)](https://github-redirect.dependabot.com/mockito/mockito/pull/2888";>mockito/mockito#2888)
   Clean up JDK-8 related code [(https://github-redirect.dependabot.com/mockito/mockito/issues/2883";>#2883)](https://github-redirect.dependabot.com/mockito/mockito/pull/2883";>mockito/mockito#2883)
   Feat: reified mock overloads [(https://github-redirect.dependabot.com/mockito/mockito/issues/2882";>#2882)](https://github-redirect.dependabot.com/mockito/mockito/pull/2882";>mockito/mockito#2882)
   Clean up JDK-8 related code [(https://github-redirect.dependabot.com/mockito/mockito/issues/2879";>#2879)](https://github-redirect.dependabot.com/mockito/mockito/issues/2879";>mockito/mockito#2879)
   Bump assertj-core from 3.24.1 to 3.24.2 [(https://github-redirect.dependabot.com/mockito/mockito/issues/2875";>#2875)](https://github-redirect.dependabot.com/mockito/mockito/pull/2875";>mockito/mockito#2875)
   Make sure the tests use mock maker with intended member accessor [(https://github-redirect.dependabot.com/mockito/mockito/issues/2872";>#2872)](https://github-redirect.dependabot.com/mockito/mockito/pull/2872";>mockito/mockito#2872)
   Bump com.diffplug.spotless from 6.12.1 to 6.13.0 [(https://github-redirect.dependabot.com/mockito/mockito/issues/2871";>#2871)](https://github-redirect.dependabot.com/mockito/mockito/pull/2871";>mockito/mockito#2871)
   Remove broken link from CONTRIBUTING.md [(https://github-redirect.dependabot.com/mockito/mockito/issues/2870";>#2870)](https://github-redirect.dependabot.com/mockito/mockito/pull/2870";>mockito/mockito#2870)
   Update outdated badge 3.x to 5.x [(https://github-redirect.dependabot.com/mockito/mockito/issues/2869";>#2869)](https://github-redirect.dependabot.com/mockito/mockito/pull/2869";>mockito/mockito#2869)
   Broken link in CONTRIBUTING.md [(https://github-redirect.dependabot.com/mockito/mockito/issues/2868";>#2868)](https://github-redirect.dependabot.com/mockito/mockito/issues/2868";>mockito/mockito#2868)
   Set current version to 5.x in README and highlight changes [(https://github-redirect.dependabot.com/mockito/mockito/issues/2867";>#2867)](https://github-redirect.dependabot.com/mockito/mockito/pull/2867";>mockito/mockito#2867)
   Annotate Mockito#{mock,spy}(T... reified) with 
@SafeVarargs [(https://github-redirect.dependabot.com/mockito/mockito/issues/2866";>#2866)](https://github-redirect.dependabot.com/mockito/mockito/pull/2866";>mockito/mockito#2866)
   Make sure the tests use mock maker with intended member accessor [(https://github-redirect.dependabot.com/mockito/mockito/issues/2855";>#2855)](https://github-redirect.dependabot.com/mockito/mockito/issues/2855";>mockito/mockito#2855)
   Improve examples for InOrder [(https://github-redirect.dependabot.com/mockito/mockito/issues/2843";>#2843)](https://github-redirect.dependabot.com/mockito/mockito/pull/2843";>mockito/mockito#2843)
   
   v5.0.0
   Mockito 5: prepare for future JDK versions
   For a while now, we have seen an increase in problems/incompatibilities 
with recent versions of the JDK due to our usage of JVM-internal API.
   Most notably, JDK 17 made some changes which are incompatible with the 
current subclass mockmaker.
   Therefore, to prepare for the future of JDK, we are making some core changes 
to ensure Mockito keeps on working.
   Switch the default mockmaker to mockito-inl

[GitHub] [httpcomponents-client] dependabot[bot] closed pull request #408: Bump mockito-core from 4.8.1 to 5.0.0

2023-02-03 Thread via GitHub


dependabot[bot] closed pull request #408: Bump mockito-core from 4.8.1 to 5.0.0
URL: https://github.com/apache/httpcomponents-client/pull/408


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] dependabot[bot] commented on pull request #408: Bump mockito-core from 4.8.1 to 5.0.0

2023-02-03 Thread via GitHub


dependabot[bot] commented on PR #408:
URL: 
https://github.com/apache/httpcomponents-client/pull/408#issuecomment-1415842335

   Superseded by #410.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] dependabot[bot] opened a new pull request, #384: Bump mockito-core from 4.11.0 to 5.1.1

2023-02-03 Thread via GitHub


dependabot[bot] opened a new pull request, #384:
URL: https://github.com/apache/httpcomponents-core/pull/384

   Bumps [mockito-core](https://github.com/mockito/mockito) from 4.11.0 to 
5.1.1.
   
   Release notes
   Sourced from https://github.com/mockito/mockito/releases";>mockito-core's 
releases.
   
   v5.1.1
   Changelog generated 
by https://github.com/shipkit/shipkit-changelog";>Shipkit Changelog 
Gradle Plugin
   5.1.1
   
   2023-01-30 - https://github.com/mockito/mockito/compare/v5.1.0...v5.1.1";>1 
commit(s) by Andriy Redko
   StackWalker.Option not found on Mockito 5.1.0 [(https://github-redirect.dependabot.com/mockito/mockito/issues/2891";>#2891)](https://github-redirect.dependabot.com/mockito/mockito/pull/2891";>mockito/mockito#2891)
   StackWalker.Option not found on Mockito 5.1.0 [(https://github-redirect.dependabot.com/mockito/mockito/issues/2890";>#2890)](https://github-redirect.dependabot.com/mockito/mockito/issues/2890";>mockito/mockito#2890)
   
   v5.1.0
   Changelog generated 
by https://github.com/shipkit/shipkit-changelog";>Shipkit Changelog 
Gradle Plugin
   5.1.0
   
   2023-01-29 - https://github.com/mockito/mockito/compare/v5.0.0...v5.1.0";>12 
commit(s) by Andriy Redko, Ashley, Róbert Papp, Stephan Schroevers, Tim te 
Beek, dependabot[bot]
   Fixes some mistakes and missing details in documentation [(https://github-redirect.dependabot.com/mockito/mockito/issues/2889";>#2889)](https://github-redirect.dependabot.com/mockito/mockito/pull/2889";>mockito/mockito#2889)
   Bump com.diffplug.spotless from 6.13.0 to 6.14.0 [(https://github-redirect.dependabot.com/mockito/mockito/issues/2888";>#2888)](https://github-redirect.dependabot.com/mockito/mockito/pull/2888";>mockito/mockito#2888)
   Clean up JDK-8 related code [(https://github-redirect.dependabot.com/mockito/mockito/issues/2883";>#2883)](https://github-redirect.dependabot.com/mockito/mockito/pull/2883";>mockito/mockito#2883)
   Feat: reified mock overloads [(https://github-redirect.dependabot.com/mockito/mockito/issues/2882";>#2882)](https://github-redirect.dependabot.com/mockito/mockito/pull/2882";>mockito/mockito#2882)
   Clean up JDK-8 related code [(https://github-redirect.dependabot.com/mockito/mockito/issues/2879";>#2879)](https://github-redirect.dependabot.com/mockito/mockito/issues/2879";>mockito/mockito#2879)
   Bump assertj-core from 3.24.1 to 3.24.2 [(https://github-redirect.dependabot.com/mockito/mockito/issues/2875";>#2875)](https://github-redirect.dependabot.com/mockito/mockito/pull/2875";>mockito/mockito#2875)
   Make sure the tests use mock maker with intended member accessor [(https://github-redirect.dependabot.com/mockito/mockito/issues/2872";>#2872)](https://github-redirect.dependabot.com/mockito/mockito/pull/2872";>mockito/mockito#2872)
   Bump com.diffplug.spotless from 6.12.1 to 6.13.0 [(https://github-redirect.dependabot.com/mockito/mockito/issues/2871";>#2871)](https://github-redirect.dependabot.com/mockito/mockito/pull/2871";>mockito/mockito#2871)
   Remove broken link from CONTRIBUTING.md [(https://github-redirect.dependabot.com/mockito/mockito/issues/2870";>#2870)](https://github-redirect.dependabot.com/mockito/mockito/pull/2870";>mockito/mockito#2870)
   Update outdated badge 3.x to 5.x [(https://github-redirect.dependabot.com/mockito/mockito/issues/2869";>#2869)](https://github-redirect.dependabot.com/mockito/mockito/pull/2869";>mockito/mockito#2869)
   Broken link in CONTRIBUTING.md [(https://github-redirect.dependabot.com/mockito/mockito/issues/2868";>#2868)](https://github-redirect.dependabot.com/mockito/mockito/issues/2868";>mockito/mockito#2868)
   Set current version to 5.x in README and highlight changes [(https://github-redirect.dependabot.com/mockito/mockito/issues/2867";>#2867)](https://github-redirect.dependabot.com/mockito/mockito/pull/2867";>mockito/mockito#2867)
   Annotate Mockito#{mock,spy}(T... reified) with 
@SafeVarargs [(https://github-redirect.dependabot.com/mockito/mockito/issues/2866";>#2866)](https://github-redirect.dependabot.com/mockito/mockito/pull/2866";>mockito/mockito#2866)
   Make sure the tests use mock maker with intended member accessor [(https://github-redirect.dependabot.com/mockito/mockito/issues/2855";>#2855)](https://github-redirect.dependabot.com/mockito/mockito/issues/2855";>mockito/mockito#2855)
   Improve examples for InOrder [(https://github-redirect.dependabot.com/mockito/mockito/issues/2843";>#2843)](https://github-redirect.dependabot.com/mockito/mockito/pull/2843";>mockito/mockito#2843)
   
   v5.0.0
   Mockito 5: prepare for future JDK versions
   For a while now, we have seen an increase in problems/incompatibilities 
with recent versions of the JDK due to our usage of JVM-internal API.
   Most notably, JDK 17 made some changes which are incompatible with the 
current subclass mockmaker.
   Therefore, to prepare for the future of JDK, we are making some core changes 
to ensure Mockito keeps on working.
   Switch the default mockmaker to mockito-inl

[GitHub] [httpcomponents-core] dependabot[bot] commented on pull request #382: Bump mockito-core from 4.11.0 to 5.0.0

2023-02-03 Thread via GitHub


dependabot[bot] commented on PR #382:
URL: 
https://github.com/apache/httpcomponents-core/pull/382#issuecomment-1415913414

   Superseded by #384.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] dependabot[bot] closed pull request #382: Bump mockito-core from 4.11.0 to 5.0.0

2023-02-03 Thread via GitHub


dependabot[bot] closed pull request #382: Bump mockito-core from 4.11.0 to 5.0.0
URL: https://github.com/apache/httpcomponents-core/pull/382


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c merged pull request #409: Remove unnecessary declarations.

2023-02-04 Thread via GitHub


ok2c merged PR #409:
URL: https://github.com/apache/httpcomponents-client/pull/409


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c commented on pull request #410: Bump mockito-core from 4.8.1 to 5.1.1

2023-02-04 Thread via GitHub


ok2c commented on PR #410:
URL: 
https://github.com/apache/httpcomponents-client/pull/410#issuecomment-1416796929

   @dependabot ignore this major version


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] dependabot[bot] closed pull request #410: Bump mockito-core from 4.8.1 to 5.1.1

2023-02-04 Thread via GitHub


dependabot[bot] closed pull request #410: Bump mockito-core from 4.8.1 to 5.1.1
URL: https://github.com/apache/httpcomponents-client/pull/410


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] dependabot[bot] commented on pull request #410: Bump mockito-core from 4.8.1 to 5.1.1

2023-02-04 Thread via GitHub


dependabot[bot] commented on PR #410:
URL: 
https://github.com/apache/httpcomponents-client/pull/410#issuecomment-1416796935

   OK, I won't notify you about version 5.x.x again, unless you re-open this 
PR. 😢


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] arturobernalg opened a new pull request, #385: Replace lambdas with method references.

2023-02-05 Thread via GitHub


arturobernalg opened a new pull request, #385:
URL: https://github.com/apache/httpcomponents-core/pull/385

   Method references are more clear and readable compared to. Of course this  
could be a matter of taste.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] arturobernalg opened a new pull request, #386: Replace new FileInputStream() and/or new FileOutputStream() expressions with Files.newInputStream() and/or Files.newOutpu

2023-02-05 Thread via GitHub


arturobernalg opened a new pull request, #386:
URL: https://github.com/apache/httpcomponents-core/pull/386

   Again,  this could be a matter of taste.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] alicejli opened a new pull request, #411: Update Apache Commons Codec from 1.11 to 1.15.

2023-02-06 Thread via GitHub


alicejli opened a new pull request, #411:
URL: https://github.com/apache/httpcomponents-client/pull/411

   There was a vulnerability found with commons-codec 
(https://sca.analysiscenter.veracode.com/vulnerability-database/security/sca/vulnerability/sid-22742/summary)
 that was fixed in v1.13.  
   The latest version is 1.15 so I've updated the dependency to the latest.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] suztomo commented on pull request #299: Updating project URL to include '-ga' suffix

2023-02-06 Thread via GitHub


suztomo commented on PR #299:
URL: 
https://github.com/apache/httpcomponents-client/pull/299#issuecomment-1419206346

   Now it's fixed 
https://search.maven.org/artifact/org.apache.httpcomponents/httpclient/4.5.14/jar


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] suztomo commented on pull request #411: Update Apache Commons Codec from 1.11 to 1.15.

2023-02-06 Thread via GitHub


suztomo commented on PR #411:
URL: 
https://github.com/apache/httpcomponents-client/pull/411#issuecomment-1419665045

   You talked about Java 6 compatibility. Can you write down findings here?


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c commented on pull request #411: Update Apache Commons Codec from 1.11 to 1.15.

2023-02-06 Thread via GitHub


ok2c commented on PR #411:
URL: 
https://github.com/apache/httpcomponents-client/pull/411#issuecomment-1419700281

   @alicejli We cannot upgrade HttpClient 4.5.x to the latest Commons Codec 
version due to Java 1.6 compatibility. Commons folks did not consider the 
security issue severe enough to warrant a release of Commons Codec compatible 
with Java 1.6. 


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c closed pull request #411: Update Apache Commons Codec from 1.11 to 1.15.

2023-02-06 Thread via GitHub


ok2c closed pull request #411: Update Apache Commons Codec from 1.11 to 1.15.
URL: https://github.com/apache/httpcomponents-client/pull/411


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] alicejli commented on pull request #411: Update Apache Commons Codec from 1.11 to 1.15.

2023-02-06 Thread via GitHub


alicejli commented on PR #411:
URL: 
https://github.com/apache/httpcomponents-client/pull/411#issuecomment-1419788638

   Thank you for clarifying - that makes sense.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on pull request #384: Bump mockito-core from 4.11.0 to 5.1.1

2023-02-08 Thread via GitHub


ok2c commented on PR #384:
URL: 
https://github.com/apache/httpcomponents-core/pull/384#issuecomment-1422407973

   @dependabot ignore this major version


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] dependabot[bot] closed pull request #384: Bump mockito-core from 4.11.0 to 5.1.1

2023-02-08 Thread via GitHub


dependabot[bot] closed pull request #384: Bump mockito-core from 4.11.0 to 5.1.1
URL: https://github.com/apache/httpcomponents-core/pull/384


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] dependabot[bot] commented on pull request #384: Bump mockito-core from 4.11.0 to 5.1.1

2023-02-08 Thread via GitHub


dependabot[bot] commented on PR #384:
URL: 
https://github.com/apache/httpcomponents-core/pull/384#issuecomment-1422408027

   OK, I won't notify you about version 5.x.x again, unless you re-open this 
PR. 😢


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on pull request #387: Added ViaRequest interceptor

2023-02-08 Thread via GitHub


ok2c commented on PR #387:
URL: 
https://github.com/apache/httpcomponents-core/pull/387#issuecomment-1422421657

   @arturobernalg Please change the target branch to `5.3.x`.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on pull request #386: Replace new FileInputStream() and/or new FileOutputStream() expressions with Files.newInputStream() and/or Files.newOutputStream()

2023-02-08 Thread via GitHub


ok2c commented on PR #386:
URL: 
https://github.com/apache/httpcomponents-core/pull/386#issuecomment-1422427841

   @arturobernalg 1. Please change the target branch to `5.3.x`. 2. I see 2 
more instances of `new File*Stream`. Please replace them as well.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] arturobernalg commented on pull request #386: Replace new FileInputStream() and/or new FileOutputStream() expressions with Files.newInputStream() and/or Files.newOutput

2023-02-08 Thread via GitHub


arturobernalg commented on PR #386:
URL: 
https://github.com/apache/httpcomponents-core/pull/386#issuecomment-1423181592

   > @arturobernalg 1. Please change the target branch to `5.3.x`. 2. I see 2 
more instances of `new File*Stream`. Please replace them as well.
   
   @ok2c Done


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] arturobernalg commented on pull request #387: Added ViaRequest interceptor

2023-02-08 Thread via GitHub


arturobernalg commented on PR #387:
URL: 
https://github.com/apache/httpcomponents-core/pull/387#issuecomment-1423181889

   > @arturobernalg Please change the target branch to `5.3.x`.
   
   @ok2c Done


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c closed pull request #310: 5.2.x java time session and deadline

2023-02-09 Thread via GitHub


ok2c closed pull request #310: 5.2.x java time session and deadline
URL: https://github.com/apache/httpcomponents-core/pull/310


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c closed pull request #350: HTTPCLIENT-2185 Add support for IDNA 2008 (RFC 5891)

2023-02-09 Thread via GitHub


ok2c closed pull request #350: HTTPCLIENT-2185 Add support for IDNA 2008 (RFC 
5891)
URL: https://github.com/apache/httpcomponents-core/pull/350


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on a diff in pull request #387: Added ViaRequest interceptor

2023-02-09 Thread via GitHub


ok2c commented on code in PR #387:
URL: 
https://github.com/apache/httpcomponents-core/pull/387#discussion_r1101928433


##
httpcore5/src/main/java/org/apache/hc/core5/http/protocol/ViaRequest.java:
##
@@ -0,0 +1,122 @@
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+package org.apache.hc.core5.http.protocol;
+
+import java.io.IOException;
+
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EntityDetails;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpHeaders;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpRequestInterceptor;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.ProtocolException;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.util.Args;
+
+
+/**
+ * An Apache HttpComponents {@link HttpRequestInterceptor} to add the {@link 
HttpHeaders#VIA} HTTP
+ * header to requests.
+ * The {@link  HttpHeaders#VIA} header is used to indicate intermediate 
protocols and recipients
+ * between the user agent and the server (on requests) or between the origin 
server and the client
+ * (on responses). It can be used for tracking message forwards, avoiding 
request loops, and
+ * identifying the protocol capabilities of senders along the request/response 
chain. Each member of
+ * the {@link HttpHeaders#VIA} header field value represents a proxy or 
gateway that has forwarded
+ * the message.
+ * A proxy MUST send an appropriate {@link  HttpHeaders#VIA} header 
field, as described
+ * in
+ * the HTTP specification, in each message that it forwards. An HTTP-to-HTTP 
gateway MUST
+ * send an appropriate {@link HttpHeaders#VIA} header field in each inbound 
request message and
+ * MAY send a {@link HttpHeaders#VIA} header field in forwarded 
response messages.
+ * This interceptor ensures that the {@link  HttpHeaders#VIA} header is 
added to the request
+ * only
+ * if it has not been added previously, as per the HTTP specification. 
Additionally, it updates the
+ * values in the {@link HttpHeaders#VIA} header correctly in case of multiple 
intermediate protocols
+ * or recipients, by appending its own information about how the message was 
received to the end of
+ * the header field value.
+ *
+ * @since 5.3
+ */
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
+public class ViaRequest implements HttpRequestInterceptor {
+
+
+/**
+ * Singleton instance.
+ */
+public static final HttpRequestInterceptor INSTANCE = new ViaRequest();
+
+/**
+ * Constructs a new {@code ViaRequest}.
+ */
+public ViaRequest() {
+}
+
+/**
+ * Adds the HTTP {@link  HttpHeaders#VIA} header to the request if it does 
not already exist.
+ *
+ * This method ensures that the version of the request is HTTP/1.1 or 
higher, and adds the
+ * Via header in the format {@code   }, where 
{@code } is the protocol name,
+ * {@code } is the major and minor version of the request, and 
{@code } is the value of the Host header.
+ *
+ * In case the {@link  HttpHeaders#VIA} header already exists, this 
method updates its value by appending
+ * the new protocol information in the same format.
+ *
+ * If the version of the request is lower than HTTP/1.1, this method 
throws a
+ * {@link ProtocolException}.
+ *
+ * @param request the request object to modify
+ * @param entity the entity for the request, may be {@code null}
+ * @param context the context for the request
+ * @throws ProtocolException if there was a protocol error
+ * @throws IOException if there was an I/O error
+ */
+@Override
+public void process(final HttpRequest request, final EntityDetails entity, 

[GitHub] [httpcomponents-core] ok2c commented on pull request #386: Replace new FileInputStream() and/or new FileOutputStream() expressions with Files.newInputStream() and/or Files.newOutputStream()

2023-02-09 Thread via GitHub


ok2c commented on PR #386:
URL: 
https://github.com/apache/httpcomponents-core/pull/386#issuecomment-1424708225

   @arturobernalg I am sorry I only now realized that the new APIs work with 
`Path` values and  therefore entail an overhead of an extra conversion from 
`File` to `Path`. I do not think it is worth it. I am sorry I have asked you to 
do extra work.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] arturobernalg commented on a diff in pull request #387: Added ViaRequest interceptor

2023-02-10 Thread via GitHub


arturobernalg commented on code in PR #387:
URL: 
https://github.com/apache/httpcomponents-core/pull/387#discussion_r1102450295


##
httpcore5/src/main/java/org/apache/hc/core5/http/protocol/ViaRequest.java:
##
@@ -0,0 +1,122 @@
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+package org.apache.hc.core5.http.protocol;
+
+import java.io.IOException;
+
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EntityDetails;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpHeaders;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpRequestInterceptor;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.ProtocolException;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.util.Args;
+
+
+/**
+ * An Apache HttpComponents {@link HttpRequestInterceptor} to add the {@link 
HttpHeaders#VIA} HTTP
+ * header to requests.
+ * The {@link  HttpHeaders#VIA} header is used to indicate intermediate 
protocols and recipients
+ * between the user agent and the server (on requests) or between the origin 
server and the client
+ * (on responses). It can be used for tracking message forwards, avoiding 
request loops, and
+ * identifying the protocol capabilities of senders along the request/response 
chain. Each member of
+ * the {@link HttpHeaders#VIA} header field value represents a proxy or 
gateway that has forwarded
+ * the message.
+ * A proxy MUST send an appropriate {@link  HttpHeaders#VIA} header 
field, as described
+ * in
+ * the HTTP specification, in each message that it forwards. An HTTP-to-HTTP 
gateway MUST
+ * send an appropriate {@link HttpHeaders#VIA} header field in each inbound 
request message and
+ * MAY send a {@link HttpHeaders#VIA} header field in forwarded 
response messages.
+ * This interceptor ensures that the {@link  HttpHeaders#VIA} header is 
added to the request
+ * only
+ * if it has not been added previously, as per the HTTP specification. 
Additionally, it updates the
+ * values in the {@link HttpHeaders#VIA} header correctly in case of multiple 
intermediate protocols
+ * or recipients, by appending its own information about how the message was 
received to the end of
+ * the header field value.
+ *
+ * @since 5.3
+ */
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
+public class ViaRequest implements HttpRequestInterceptor {
+
+
+/**
+ * Singleton instance.
+ */
+public static final HttpRequestInterceptor INSTANCE = new ViaRequest();
+
+/**
+ * Constructs a new {@code ViaRequest}.
+ */
+public ViaRequest() {
+}
+
+/**
+ * Adds the HTTP {@link  HttpHeaders#VIA} header to the request if it does 
not already exist.
+ *
+ * This method ensures that the version of the request is HTTP/1.1 or 
higher, and adds the
+ * Via header in the format {@code   }, where 
{@code } is the protocol name,
+ * {@code } is the major and minor version of the request, and 
{@code } is the value of the Host header.
+ *
+ * In case the {@link  HttpHeaders#VIA} header already exists, this 
method updates its value by appending
+ * the new protocol information in the same format.
+ *
+ * If the version of the request is lower than HTTP/1.1, this method 
throws a
+ * {@link ProtocolException}.
+ *
+ * @param request the request object to modify
+ * @param entity the entity for the request, may be {@code null}
+ * @param context the context for the request
+ * @throws ProtocolException if there was a protocol error
+ * @throws IOException if there was an I/O error
+ */
+@Override
+public void process(final HttpRequest request, final EntityDetails 

[GitHub] [httpcomponents-core] arturobernalg opened a new pull request, #388: Fix the issue with invalid scoped IPv6 addresses in InetAddressUtils.

2023-02-10 Thread via GitHub


arturobernalg opened a new pull request, #388:
URL: https://github.com/apache/httpcomponents-core/pull/388

   This Pull Request addresses the issue of properly handling scoped IPv6 
addresses in the InetAddressUtils class. The previous implementation had 
incorrect behavior when handling scoped IPv6 addresses. This fix updates the 
logic to properly check the format of the scope ID and to return false when the 
address is not a valid standard or compressed IPv6 address.
   


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on a diff in pull request #387: Added ViaRequest interceptor

2023-02-10 Thread via GitHub


ok2c commented on code in PR #387:
URL: 
https://github.com/apache/httpcomponents-core/pull/387#discussion_r1102694216


##
httpcore5/src/main/java/org/apache/hc/core5/http/protocol/ViaRequest.java:
##
@@ -0,0 +1,127 @@
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+package org.apache.hc.core5.http.protocol;
+
+import java.io.IOException;
+
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EntityDetails;
+import org.apache.hc.core5.http.HttpHeaders;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpRequestInterceptor;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.ProtocolException;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.net.URIAuthority;
+import org.apache.hc.core5.util.Args;
+
+
+/**
+ * An Apache HttpComponents {@link HttpRequestInterceptor} to add the {@link 
HttpHeaders#VIA} HTTP
+ * header to requests.
+ * The {@link  HttpHeaders#VIA} header is used to indicate intermediate 
protocols and recipients
+ * between the user agent and the server (on requests) or between the origin 
server and the client
+ * (on responses). It can be used for tracking message forwards, avoiding 
request loops, and
+ * identifying the protocol capabilities of senders along the request/response 
chain. Each member of
+ * the {@link HttpHeaders#VIA} header field value represents a proxy or 
gateway that has forwarded
+ * the message.
+ * A proxy MUST send an appropriate {@link  HttpHeaders#VIA} header 
field, as described
+ * in
+ * the HTTP specification, in each message that it forwards. An HTTP-to-HTTP 
gateway MUST
+ * send an appropriate {@link HttpHeaders#VIA} header field in each inbound 
request message and
+ * MAY send a {@link HttpHeaders#VIA} header field in forwarded 
response messages.
+ * This interceptor ensures that the {@link  HttpHeaders#VIA} header is 
added to the request
+ * only
+ * if it has not been added previously, as per the HTTP specification. 
Additionally, it updates the
+ * values in the {@link HttpHeaders#VIA} header correctly in case of multiple 
intermediate protocols
+ * or recipients, by appending its own information about how the message was 
received to the end of
+ * the header field value.
+ *
+ * @since 5.3
+ */
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
+public class ViaRequest implements HttpRequestInterceptor {
+
+
+/**
+ * Singleton instance.
+ */
+public static final HttpRequestInterceptor INSTANCE = new ViaRequest();
+
+/**
+ * Constructs a new {@code ViaRequest}.
+ */
+public ViaRequest() {
+}
+
+/**
+ * Adds the HTTP {@link  HttpHeaders#VIA} header to the request if it does 
not already exist.
+ *
+ * This method ensures that the version of the request is HTTP/1.1 or 
higher, and adds the
+ * Via header in the format {@code   }, where 
{@code } is the protocol name,
+ * {@code } is the major and minor version of the request, and 
{@code } is the value of the Host header.
+ *
+ * In case the {@link  HttpHeaders#VIA} header already exists, this 
method updates its value by appending
+ * the new protocol information in the same format.
+ *
+ * If the version of the request is lower than {@code HTTP/1.1} or the 
request authority not being specified,
+ * this method throws a {@link ProtocolException}.
+ *
+ * @param request the request object to modify
+ * @param entity the entity for the request, may be {@code null}
+ * @param context the context for the request
+ * @throws ProtocolException if there was a protocol error, such as the 
request version being lower than {@code HTTP/1.1},
+ * or the request autho

[GitHub] [httpcomponents-core] ok2c commented on a diff in pull request #387: Added ViaRequest interceptor

2023-02-10 Thread via GitHub


ok2c commented on code in PR #387:
URL: 
https://github.com/apache/httpcomponents-core/pull/387#discussion_r1102694216


##
httpcore5/src/main/java/org/apache/hc/core5/http/protocol/ViaRequest.java:
##
@@ -0,0 +1,127 @@
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+package org.apache.hc.core5.http.protocol;
+
+import java.io.IOException;
+
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EntityDetails;
+import org.apache.hc.core5.http.HttpHeaders;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpRequestInterceptor;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.ProtocolException;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.net.URIAuthority;
+import org.apache.hc.core5.util.Args;
+
+
+/**
+ * An Apache HttpComponents {@link HttpRequestInterceptor} to add the {@link 
HttpHeaders#VIA} HTTP
+ * header to requests.
+ * The {@link  HttpHeaders#VIA} header is used to indicate intermediate 
protocols and recipients
+ * between the user agent and the server (on requests) or between the origin 
server and the client
+ * (on responses). It can be used for tracking message forwards, avoiding 
request loops, and
+ * identifying the protocol capabilities of senders along the request/response 
chain. Each member of
+ * the {@link HttpHeaders#VIA} header field value represents a proxy or 
gateway that has forwarded
+ * the message.
+ * A proxy MUST send an appropriate {@link  HttpHeaders#VIA} header 
field, as described
+ * in
+ * the HTTP specification, in each message that it forwards. An HTTP-to-HTTP 
gateway MUST
+ * send an appropriate {@link HttpHeaders#VIA} header field in each inbound 
request message and
+ * MAY send a {@link HttpHeaders#VIA} header field in forwarded 
response messages.
+ * This interceptor ensures that the {@link  HttpHeaders#VIA} header is 
added to the request
+ * only
+ * if it has not been added previously, as per the HTTP specification. 
Additionally, it updates the
+ * values in the {@link HttpHeaders#VIA} header correctly in case of multiple 
intermediate protocols
+ * or recipients, by appending its own information about how the message was 
received to the end of
+ * the header field value.
+ *
+ * @since 5.3
+ */
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
+public class ViaRequest implements HttpRequestInterceptor {
+
+
+/**
+ * Singleton instance.
+ */
+public static final HttpRequestInterceptor INSTANCE = new ViaRequest();
+
+/**
+ * Constructs a new {@code ViaRequest}.
+ */
+public ViaRequest() {
+}
+
+/**
+ * Adds the HTTP {@link  HttpHeaders#VIA} header to the request if it does 
not already exist.
+ *
+ * This method ensures that the version of the request is HTTP/1.1 or 
higher, and adds the
+ * Via header in the format {@code   }, where 
{@code } is the protocol name,
+ * {@code } is the major and minor version of the request, and 
{@code } is the value of the Host header.
+ *
+ * In case the {@link  HttpHeaders#VIA} header already exists, this 
method updates its value by appending
+ * the new protocol information in the same format.
+ *
+ * If the version of the request is lower than {@code HTTP/1.1} or the 
request authority not being specified,
+ * this method throws a {@link ProtocolException}.
+ *
+ * @param request the request object to modify
+ * @param entity the entity for the request, may be {@code null}
+ * @param context the context for the request
+ * @throws ProtocolException if there was a protocol error, such as the 
request version being lower than {@code HTTP/1.1},
+ * or the request autho

[GitHub] [httpcomponents-core] ok2c commented on a diff in pull request #388: Fix the issue with invalid scoped IPv6 addresses in InetAddressUtils.

2023-02-10 Thread via GitHub


ok2c commented on code in PR #388:
URL: 
https://github.com/apache/httpcomponents-core/pull/388#discussion_r1102701888


##
httpcore5/src/main/java/org/apache/hc/core5/net/InetAddressUtils.java:
##
@@ -139,7 +152,32 @@ public static boolean isIPv6HexCompressedAddress(final 
String input) {
  * @return true if the input parameter is a valid standard or compressed 
IPv6 address
  */
 public static boolean isIPv6Address(final String input) {
-return isIPv6StdAddress(input) || isIPv6HexCompressedAddress(input);
+final int index = input.indexOf(SCOPE_ID_DELIMITER);
+if (index == -1) {
+return isIPv6StdAddress(input) || 
isIPv6HexCompressedAddress(input);
+} else {
+return isIPv6ScopedAddress(input);
+}
+}
+
+/**
+ * Determines whether the given string represents a valid scoped IPv6 
address.
+ * A scoped IPv6 address includes a scope identifier (e.g. 
"fe80::1ff:fe23:4567:890a%eth2").
+ *
+ * @param input the string to be tested
+ * @return {@code true} if the string represents a valid scoped IPv6 
address, {@code false} otherwise
+ */
+private static boolean isIPv6ScopedAddress(final String input) {
+final int index = input.indexOf(SCOPE_ID_DELIMITER);

Review Comment:
   @arturobernalg How about folding this method into `#isIPv6Address` and doing 
`input.indexOf(SCOPE_ID_DELIMITER)` only once?



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] arturobernalg commented on a diff in pull request #387: Added ViaRequest interceptor

2023-02-10 Thread via GitHub


arturobernalg commented on code in PR #387:
URL: 
https://github.com/apache/httpcomponents-core/pull/387#discussion_r1102703920


##
httpcore5/src/main/java/org/apache/hc/core5/http/protocol/ViaRequest.java:
##
@@ -0,0 +1,127 @@
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+package org.apache.hc.core5.http.protocol;
+
+import java.io.IOException;
+
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EntityDetails;
+import org.apache.hc.core5.http.HttpHeaders;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpRequestInterceptor;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.ProtocolException;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.net.URIAuthority;
+import org.apache.hc.core5.util.Args;
+
+
+/**
+ * An Apache HttpComponents {@link HttpRequestInterceptor} to add the {@link 
HttpHeaders#VIA} HTTP
+ * header to requests.
+ * The {@link  HttpHeaders#VIA} header is used to indicate intermediate 
protocols and recipients
+ * between the user agent and the server (on requests) or between the origin 
server and the client
+ * (on responses). It can be used for tracking message forwards, avoiding 
request loops, and
+ * identifying the protocol capabilities of senders along the request/response 
chain. Each member of
+ * the {@link HttpHeaders#VIA} header field value represents a proxy or 
gateway that has forwarded
+ * the message.
+ * A proxy MUST send an appropriate {@link  HttpHeaders#VIA} header 
field, as described
+ * in
+ * the HTTP specification, in each message that it forwards. An HTTP-to-HTTP 
gateway MUST
+ * send an appropriate {@link HttpHeaders#VIA} header field in each inbound 
request message and
+ * MAY send a {@link HttpHeaders#VIA} header field in forwarded 
response messages.
+ * This interceptor ensures that the {@link  HttpHeaders#VIA} header is 
added to the request
+ * only
+ * if it has not been added previously, as per the HTTP specification. 
Additionally, it updates the
+ * values in the {@link HttpHeaders#VIA} header correctly in case of multiple 
intermediate protocols
+ * or recipients, by appending its own information about how the message was 
received to the end of
+ * the header field value.
+ *
+ * @since 5.3
+ */
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
+public class ViaRequest implements HttpRequestInterceptor {
+
+
+/**
+ * Singleton instance.
+ */
+public static final HttpRequestInterceptor INSTANCE = new ViaRequest();
+
+/**
+ * Constructs a new {@code ViaRequest}.
+ */
+public ViaRequest() {
+}
+
+/**
+ * Adds the HTTP {@link  HttpHeaders#VIA} header to the request if it does 
not already exist.
+ *
+ * This method ensures that the version of the request is HTTP/1.1 or 
higher, and adds the
+ * Via header in the format {@code   }, where 
{@code } is the protocol name,
+ * {@code } is the major and minor version of the request, and 
{@code } is the value of the Host header.
+ *
+ * In case the {@link  HttpHeaders#VIA} header already exists, this 
method updates its value by appending
+ * the new protocol information in the same format.
+ *
+ * If the version of the request is lower than {@code HTTP/1.1} or the 
request authority not being specified,
+ * this method throws a {@link ProtocolException}.
+ *
+ * @param request the request object to modify
+ * @param entity the entity for the request, may be {@code null}
+ * @param context the context for the request
+ * @throws ProtocolException if there was a protocol error, such as the 
request version being lower than {@code HTTP/1.1},
+ * or the requ

[GitHub] [httpcomponents-core] arturobernalg commented on a diff in pull request #387: Added ViaRequest interceptor

2023-02-10 Thread via GitHub


arturobernalg commented on code in PR #387:
URL: 
https://github.com/apache/httpcomponents-core/pull/387#discussion_r1102703920


##
httpcore5/src/main/java/org/apache/hc/core5/http/protocol/ViaRequest.java:
##
@@ -0,0 +1,127 @@
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+package org.apache.hc.core5.http.protocol;
+
+import java.io.IOException;
+
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EntityDetails;
+import org.apache.hc.core5.http.HttpHeaders;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpRequestInterceptor;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.ProtocolException;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.net.URIAuthority;
+import org.apache.hc.core5.util.Args;
+
+
+/**
+ * An Apache HttpComponents {@link HttpRequestInterceptor} to add the {@link 
HttpHeaders#VIA} HTTP
+ * header to requests.
+ * The {@link  HttpHeaders#VIA} header is used to indicate intermediate 
protocols and recipients
+ * between the user agent and the server (on requests) or between the origin 
server and the client
+ * (on responses). It can be used for tracking message forwards, avoiding 
request loops, and
+ * identifying the protocol capabilities of senders along the request/response 
chain. Each member of
+ * the {@link HttpHeaders#VIA} header field value represents a proxy or 
gateway that has forwarded
+ * the message.
+ * A proxy MUST send an appropriate {@link  HttpHeaders#VIA} header 
field, as described
+ * in
+ * the HTTP specification, in each message that it forwards. An HTTP-to-HTTP 
gateway MUST
+ * send an appropriate {@link HttpHeaders#VIA} header field in each inbound 
request message and
+ * MAY send a {@link HttpHeaders#VIA} header field in forwarded 
response messages.
+ * This interceptor ensures that the {@link  HttpHeaders#VIA} header is 
added to the request
+ * only
+ * if it has not been added previously, as per the HTTP specification. 
Additionally, it updates the
+ * values in the {@link HttpHeaders#VIA} header correctly in case of multiple 
intermediate protocols
+ * or recipients, by appending its own information about how the message was 
received to the end of
+ * the header field value.
+ *
+ * @since 5.3
+ */
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
+public class ViaRequest implements HttpRequestInterceptor {
+
+
+/**
+ * Singleton instance.
+ */
+public static final HttpRequestInterceptor INSTANCE = new ViaRequest();
+
+/**
+ * Constructs a new {@code ViaRequest}.
+ */
+public ViaRequest() {
+}
+
+/**
+ * Adds the HTTP {@link  HttpHeaders#VIA} header to the request if it does 
not already exist.
+ *
+ * This method ensures that the version of the request is HTTP/1.1 or 
higher, and adds the
+ * Via header in the format {@code   }, where 
{@code } is the protocol name,
+ * {@code } is the major and minor version of the request, and 
{@code } is the value of the Host header.
+ *
+ * In case the {@link  HttpHeaders#VIA} header already exists, this 
method updates its value by appending
+ * the new protocol information in the same format.
+ *
+ * If the version of the request is lower than {@code HTTP/1.1} or the 
request authority not being specified,
+ * this method throws a {@link ProtocolException}.
+ *
+ * @param request the request object to modify
+ * @param entity the entity for the request, may be {@code null}
+ * @param context the context for the request
+ * @throws ProtocolException if there was a protocol error, such as the 
request version being lower than {@code HTTP/1.1},
+ * or the requ

[GitHub] [httpcomponents-core] ok2c commented on a diff in pull request #387: Added ViaRequest interceptor

2023-02-10 Thread via GitHub


ok2c commented on code in PR #387:
URL: 
https://github.com/apache/httpcomponents-core/pull/387#discussion_r1102705147


##
httpcore5/src/main/java/org/apache/hc/core5/http/protocol/ViaRequest.java:
##
@@ -0,0 +1,127 @@
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+package org.apache.hc.core5.http.protocol;
+
+import java.io.IOException;
+
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EntityDetails;
+import org.apache.hc.core5.http.HttpHeaders;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpRequestInterceptor;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.ProtocolException;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.net.URIAuthority;
+import org.apache.hc.core5.util.Args;
+
+
+/**
+ * An Apache HttpComponents {@link HttpRequestInterceptor} to add the {@link 
HttpHeaders#VIA} HTTP
+ * header to requests.
+ * The {@link  HttpHeaders#VIA} header is used to indicate intermediate 
protocols and recipients
+ * between the user agent and the server (on requests) or between the origin 
server and the client
+ * (on responses). It can be used for tracking message forwards, avoiding 
request loops, and
+ * identifying the protocol capabilities of senders along the request/response 
chain. Each member of
+ * the {@link HttpHeaders#VIA} header field value represents a proxy or 
gateway that has forwarded
+ * the message.
+ * A proxy MUST send an appropriate {@link  HttpHeaders#VIA} header 
field, as described
+ * in
+ * the HTTP specification, in each message that it forwards. An HTTP-to-HTTP 
gateway MUST
+ * send an appropriate {@link HttpHeaders#VIA} header field in each inbound 
request message and
+ * MAY send a {@link HttpHeaders#VIA} header field in forwarded 
response messages.
+ * This interceptor ensures that the {@link  HttpHeaders#VIA} header is 
added to the request
+ * only
+ * if it has not been added previously, as per the HTTP specification. 
Additionally, it updates the
+ * values in the {@link HttpHeaders#VIA} header correctly in case of multiple 
intermediate protocols
+ * or recipients, by appending its own information about how the message was 
received to the end of
+ * the header field value.
+ *
+ * @since 5.3
+ */
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
+public class ViaRequest implements HttpRequestInterceptor {
+
+
+/**
+ * Singleton instance.
+ */
+public static final HttpRequestInterceptor INSTANCE = new ViaRequest();
+
+/**
+ * Constructs a new {@code ViaRequest}.
+ */
+public ViaRequest() {
+}
+
+/**
+ * Adds the HTTP {@link  HttpHeaders#VIA} header to the request if it does 
not already exist.
+ *
+ * This method ensures that the version of the request is HTTP/1.1 or 
higher, and adds the
+ * Via header in the format {@code   }, where 
{@code } is the protocol name,
+ * {@code } is the major and minor version of the request, and 
{@code } is the value of the Host header.
+ *
+ * In case the {@link  HttpHeaders#VIA} header already exists, this 
method updates its value by appending
+ * the new protocol information in the same format.
+ *
+ * If the version of the request is lower than {@code HTTP/1.1} or the 
request authority not being specified,
+ * this method throws a {@link ProtocolException}.
+ *
+ * @param request the request object to modify
+ * @param entity the entity for the request, may be {@code null}
+ * @param context the context for the request
+ * @throws ProtocolException if there was a protocol error, such as the 
request version being lower than {@code HTTP/1.1},
+ * or the request autho

[GitHub] [httpcomponents-core] ok2c merged pull request #387: Added ViaRequest interceptor

2023-02-10 Thread via GitHub


ok2c merged PR #387:
URL: https://github.com/apache/httpcomponents-core/pull/387


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on a diff in pull request #387: Added ViaRequest interceptor

2023-02-10 Thread via GitHub


ok2c commented on code in PR #387:
URL: 
https://github.com/apache/httpcomponents-core/pull/387#discussion_r1102712447


##
httpcore5/src/main/java/org/apache/hc/core5/http/protocol/ViaRequest.java:
##
@@ -0,0 +1,122 @@
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+package org.apache.hc.core5.http.protocol;
+
+import java.io.IOException;
+
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EntityDetails;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpHeaders;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpRequestInterceptor;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.ProtocolException;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.util.Args;
+
+
+/**
+ * An Apache HttpComponents {@link HttpRequestInterceptor} to add the {@link 
HttpHeaders#VIA} HTTP
+ * header to requests.
+ * The {@link  HttpHeaders#VIA} header is used to indicate intermediate 
protocols and recipients
+ * between the user agent and the server (on requests) or between the origin 
server and the client
+ * (on responses). It can be used for tracking message forwards, avoiding 
request loops, and
+ * identifying the protocol capabilities of senders along the request/response 
chain. Each member of
+ * the {@link HttpHeaders#VIA} header field value represents a proxy or 
gateway that has forwarded
+ * the message.
+ * A proxy MUST send an appropriate {@link  HttpHeaders#VIA} header 
field, as described
+ * in
+ * the HTTP specification, in each message that it forwards. An HTTP-to-HTTP 
gateway MUST
+ * send an appropriate {@link HttpHeaders#VIA} header field in each inbound 
request message and
+ * MAY send a {@link HttpHeaders#VIA} header field in forwarded 
response messages.
+ * This interceptor ensures that the {@link  HttpHeaders#VIA} header is 
added to the request
+ * only
+ * if it has not been added previously, as per the HTTP specification. 
Additionally, it updates the
+ * values in the {@link HttpHeaders#VIA} header correctly in case of multiple 
intermediate protocols
+ * or recipients, by appending its own information about how the message was 
received to the end of
+ * the header field value.
+ *
+ * @since 5.3
+ */
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
+public class ViaRequest implements HttpRequestInterceptor {
+
+
+/**
+ * Singleton instance.
+ */
+public static final HttpRequestInterceptor INSTANCE = new ViaRequest();
+
+/**
+ * Constructs a new {@code ViaRequest}.
+ */
+public ViaRequest() {
+}
+
+/**
+ * Adds the HTTP {@link  HttpHeaders#VIA} header to the request if it does 
not already exist.
+ *
+ * This method ensures that the version of the request is HTTP/1.1 or 
higher, and adds the
+ * Via header in the format {@code   }, where 
{@code } is the protocol name,
+ * {@code } is the major and minor version of the request, and 
{@code } is the value of the Host header.
+ *
+ * In case the {@link  HttpHeaders#VIA} header already exists, this 
method updates its value by appending
+ * the new protocol information in the same format.
+ *
+ * If the version of the request is lower than HTTP/1.1, this method 
throws a
+ * {@link ProtocolException}.
+ *
+ * @param request the request object to modify
+ * @param entity the entity for the request, may be {@code null}
+ * @param context the context for the request
+ * @throws ProtocolException if there was a protocol error
+ * @throws IOException if there was an I/O error
+ */
+@Override
+public void process(final HttpRequest request, final EntityDetails entity, 

[GitHub] [httpcomponents-core] arturobernalg commented on a diff in pull request #388: Fix the issue with invalid scoped IPv6 addresses in InetAddressUtils.

2023-02-10 Thread via GitHub


arturobernalg commented on code in PR #388:
URL: 
https://github.com/apache/httpcomponents-core/pull/388#discussion_r1102728702


##
httpcore5/src/main/java/org/apache/hc/core5/net/InetAddressUtils.java:
##
@@ -139,7 +152,32 @@ public static boolean isIPv6HexCompressedAddress(final 
String input) {
  * @return true if the input parameter is a valid standard or compressed 
IPv6 address
  */
 public static boolean isIPv6Address(final String input) {
-return isIPv6StdAddress(input) || isIPv6HexCompressedAddress(input);
+final int index = input.indexOf(SCOPE_ID_DELIMITER);
+if (index == -1) {
+return isIPv6StdAddress(input) || 
isIPv6HexCompressedAddress(input);
+} else {
+return isIPv6ScopedAddress(input);
+}
+}
+
+/**
+ * Determines whether the given string represents a valid scoped IPv6 
address.
+ * A scoped IPv6 address includes a scope identifier (e.g. 
"fe80::1ff:fe23:4567:890a%eth2").
+ *
+ * @param input the string to be tested
+ * @return {@code true} if the string represents a valid scoped IPv6 
address, {@code false} otherwise
+ */
+private static boolean isIPv6ScopedAddress(final String input) {
+final int index = input.indexOf(SCOPE_ID_DELIMITER);

Review Comment:
   hi @ok2c 
   Yes. sound logical.
   TY



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] arturobernalg closed pull request #386: Replace new FileInputStream() and/or new FileOutputStream() expressions with Files.newInputStream() and/or Files.newOutputStream

2023-02-10 Thread via GitHub


arturobernalg closed pull request #386: Replace new FileInputStream() and/or 
new FileOutputStream() expressions  with Files.newInputStream() and/or 
Files.newOutputStream() calls respectively.
URL: https://github.com/apache/httpcomponents-core/pull/386


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] arturobernalg commented on pull request #386: Replace new FileInputStream() and/or new FileOutputStream() expressions with Files.newInputStream() and/or Files.newOutput

2023-02-10 Thread via GitHub


arturobernalg commented on PR #386:
URL: 
https://github.com/apache/httpcomponents-core/pull/386#issuecomment-1425765754

   > @arturobernalg I am sorry I only now realized that the new APIs work with 
`Path` values and therefore entail an overhead of an extra conversion from 
`File` to `Path`. I do not think it is worth it. I am sorry I have asked you to 
do extra work.
   
   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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] dependabot[bot] opened a new pull request, #389: Bump docker-maven-plugin from 0.31.0 to 0.41.0

2023-02-10 Thread via GitHub


dependabot[bot] opened a new pull request, #389:
URL: https://github.com/apache/httpcomponents-core/pull/389

   Bumps 
[docker-maven-plugin](https://github.com/fabric8io/docker-maven-plugin) from 
0.31.0 to 0.41.0.
   
   Release notes
   Sourced from https://github.com/fabric8io/docker-maven-plugin/releases";>docker-maven-plugin's
 releases.
   
   0.41.0 (2023-02-06):
   
   multi-arch build should use provided repository (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1597";>1597)
 https://github.com/merikan";>@​merikan
   new property docker.build.network to override the network 
for RUN directives for docker build (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1636";>1636)
 https://github.com/tulinkry";>@​tulinkry
   Update Jib Core to v0.23.0 (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1637";>1637)
 https://github.com/rohanKanojia";>@​rohanKanojia
   Update JNR UnixSocket to v0.38.19 (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1638";>1638)
 https://github.com/rohanKanojia";>@​rohanKanojia
   
   0.40.3 (2022-12-18)
   
   image/squash option is taken into account when using buildx (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1605";>1605)
 https://github.com/kevinleturc";>@​kevinleturc
   Allow having build args with same name but different value in various 
sources, which are overriden in the order of precedence in resulting build args 
map (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1407";>1407)
 https://github.com/pavelsmolensky";>@​pavelsmolensky
   Use double for docker.cpus property and interpret this 
value in the same way as Docker config option --cpus (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1609";>1609)
 https://github.com/vjuranek";>@​vjuranek
   NPE from Assembly plugin when POM packaging is used (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1146";>1146)
 https://github.com/slawekjaranowski";>@​slawekjaranowski
   Docker pulling progress only shown after pull has completed and not in 
real-time (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1598";>1598)
 https://github.com/causalnet";>@​causalnet
   Bump org.yaml:snakeyaml to v1.32 (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1619";>1619)
 https://github.com/pen4";>@​pen4
   Bump com.google.cloud.tools:jib-core to v0.23.0 (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1620";>1620)
 https://github.com/pen4";>@​pen4
   Bump com.google.guava:guava to v31.1-jre https://github.com/rohanKanojia";>@​rohanKanojia
   
   0.40.2 (2022-07-31)
   
   Plugin doesn't abort building an image in case Podman is used and 
Dockerfile can't be processed (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1512";>1562)
 https://github.com/jh-cd";>@​jh-cd
   Bump gson from 2.8.5 to 2.8.9 (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1556";>1556)
 https://github.com/dependabot";>@​dependabot
   Build and load native platform during build goal, build and push all 
platforms during push goal (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1576";>1576)
 https://github.com/chonton";>@​chonton
   Remove buildx cache, don't delete builder instances after goal. Use 
builder instance to cache artifacts (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1579";>1579)
 https://github.com/chonton";>@​chonton
   Multiple assemblies use the name "maven". Please assign each 
assembly a unique name (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1558";>1558)
 https://github.com/tbfky";>@​tbfky
   Use https://index.docker.io/v1/ as default buildx server 
registry (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1574";>1574)
 https://github.com/chonton";>@​chonton
   When using buildx, do not force build of native platform  (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1572";>1572)
 https://github.com/chonton";>@​chonton
   
   0.40.1 (2022-06-11)
   
   buildx does not work when specifying Dockerfile location (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1562";>1562)
 https://github.com/chonton";>@​chonton
   Use buildx, set tag to current version fails if it contains 
-SNAPSHOT (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1566";>1566)
 https://github.com/chonton";>@​chonton
   
   0.40.0 (2022-05-29):
   
   Multi-architecture images using buildx (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1502";>1502)
 https://github.com/chonton";>@​chonton
   Migrate to JUnit5 and Mockito for testing (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/15

[GitHub] [httpcomponents-core] dependabot[bot] commented on pull request #379: Bump docker-maven-plugin from 0.31.0 to 0.40.3

2023-02-10 Thread via GitHub


dependabot[bot] commented on PR #379:
URL: 
https://github.com/apache/httpcomponents-core/pull/379#issuecomment-1425924067

   Superseded by #389.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] dependabot[bot] closed pull request #379: Bump docker-maven-plugin from 0.31.0 to 0.40.3

2023-02-10 Thread via GitHub


dependabot[bot] closed pull request #379: Bump docker-maven-plugin from 0.31.0 
to 0.40.3
URL: https://github.com/apache/httpcomponents-core/pull/379


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on pull request #388: Fix the issue with invalid scoped IPv6 addresses in InetAddressUtils.

2023-02-10 Thread via GitHub


ok2c commented on PR #388:
URL: 
https://github.com/apache/httpcomponents-core/pull/388#issuecomment-1425939043

   @arturobernalg Could you please change the target branch to 5.3.x? Otherwise 
looks good.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c merged pull request #388: Fix the issue with invalid scoped IPv6 addresses in InetAddressUtils.

2023-02-10 Thread via GitHub


ok2c merged PR #388:
URL: https://github.com/apache/httpcomponents-core/pull/388


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] arturobernalg opened a new pull request, #390: Add a "Forwarded" HttpRequestInterceptor to add the "Forwarded" HTTP header.

2023-02-12 Thread via GitHub


arturobernalg opened a new pull request, #390:
URL: https://github.com/apache/httpcomponents-core/pull/390

   This pull request adds support for the Forwarded header to improve 
debugging, statistics, and location-dependent content generation. The Forwarded 
header contains information added by reverse proxy servers (load balancers, 
CDNs, etc.) that would otherwise be altered or lost when proxy servers are 
involved in the request path. The header can be used to identify the original 
request's IP address, host, and protocol, which can be valuable information for 
debugging, tracking traffic, and generating location-specific content.
   
   By adding support for the Forwarded header, we can ensure that the complete 
request information is captured and available for use in debugging, tracking, 
and content generation. This can lead to more accurate logs, improved site 
performance, and better user experiences.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on a diff in pull request #390: Add a "Forwarded" HttpRequestInterceptor to add the "Forwarded" HTTP header.

2023-02-13 Thread via GitHub


ok2c commented on code in PR #390:
URL: 
https://github.com/apache/httpcomponents-core/pull/390#discussion_r1104408830


##
httpcore5/src/main/java/org/apache/hc/core5/http/protocol/ForwardedRequest.java:
##
@@ -0,0 +1,159 @@
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+
+package org.apache.hc.core5.http.protocol;
+
+import java.io.IOException;
+
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EndpointDetails;
+import org.apache.hc.core5.http.EntityDetails;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpException;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpRequestInterceptor;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.ProtocolException;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.net.URIAuthority;
+import org.apache.hc.core5.util.Args;
+
+/**
+ * The ForwardedHeaderInterceptor class is a `HttpRequestInterceptor` that can 
be used to add the
+ * Forwarded header to an HTTP request. The Forwarded header is used to 
capture information about
+ * the intermediate nodes that a request has passed through. This information 
can be useful for
+ * security purposes or for debugging purposes.
+ * 
+ * The Forwarded header consists of a list of key-value pairs separated by 
semicolons. The keys that
+ * can be used in the Forwarded header include "host", "port", "proto", "for", 
and "by". The host
+ * key is used to specify the host name or IP address of the request 
authority. The port key is used
+ * to specify the port number of the request authority. The proto key is used 
to specify the
+ * protocol version of the request. The for key is used to specify the IP 
address of the client
+ * making the request. The by key is used to specify the IP address of the 
node adding the Forwarded
+ * header.
+ * 
+ * When multiple proxy servers are involved in forwarding a request, each 
proxy can add its own
+ * Forwarded header to the request. This allows for the capture of information 
about each
+ * intermediate node that the request passes through.
+ * 
+ * In this implementation, the Forwarded header is added to the request by the 
`process` method. The
+ * method first retrieves the ProtocolVersion and URIAuthority from the 
HttpContext. The
+ * ProtocolVersion is used to determine the proto key value and the 
URIAuthority is used to
+ * determine the host and port key values. The method also retrieves the 
EndpointDetails and
+ * "X-Forwarded-For" header from the HttpContext, if they exist. The 
EndpointDetails is used to
+ * determine the for key value and the "X-Forwarded-For" header is used to 
determine the by key
+ * value. If the "X-Forwarded-For" header does not exist, the by key value is 
set to "unknown".
+ * 
+ * The Forwarded header is added to the request by calling the 
`HttpRequest.addHeader` method. If a
+ * Forwarded header already exists in the request, the new key-value pairs are 
appended to the
+ * existing header.
+ *
+ * @since 5.3
+ */
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
+public class ForwardedRequest implements HttpRequestInterceptor {
+
+/**
+ * The name of the header to set in the HTTP request.
+ */
+private static final String X_FORWARDED_HEADER_NAME = "X-Forwarded-For";
+
+/**
+ * The name of the header to set in the HTTP request.
+ */
+private static final String FORWARDED_HEADER_NAME = "Forwarded";
+
+
+/**
+ * Singleton instance.
+ */
+public static final HttpRequestInterceptor INSTANCE = new 
ForwardedRequest();
+
+
+/**
+ * Adds a Forwarded header to the specified HTTP re

[GitHub] [httpcomponents-core] arturobernalg commented on a diff in pull request #390: Add a "Forwarded" HttpRequestInterceptor to add the "Forwarded" HTTP header.

2023-02-13 Thread via GitHub


arturobernalg commented on code in PR #390:
URL: 
https://github.com/apache/httpcomponents-core/pull/390#discussion_r1104989176


##
httpcore5/src/main/java/org/apache/hc/core5/http/protocol/ForwardedRequest.java:
##
@@ -0,0 +1,159 @@
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+
+package org.apache.hc.core5.http.protocol;
+
+import java.io.IOException;
+
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EndpointDetails;
+import org.apache.hc.core5.http.EntityDetails;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpException;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpRequestInterceptor;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.ProtocolException;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.net.URIAuthority;
+import org.apache.hc.core5.util.Args;
+
+/**
+ * The ForwardedHeaderInterceptor class is a `HttpRequestInterceptor` that can 
be used to add the
+ * Forwarded header to an HTTP request. The Forwarded header is used to 
capture information about
+ * the intermediate nodes that a request has passed through. This information 
can be useful for
+ * security purposes or for debugging purposes.
+ * 
+ * The Forwarded header consists of a list of key-value pairs separated by 
semicolons. The keys that
+ * can be used in the Forwarded header include "host", "port", "proto", "for", 
and "by". The host
+ * key is used to specify the host name or IP address of the request 
authority. The port key is used
+ * to specify the port number of the request authority. The proto key is used 
to specify the
+ * protocol version of the request. The for key is used to specify the IP 
address of the client
+ * making the request. The by key is used to specify the IP address of the 
node adding the Forwarded
+ * header.
+ * 
+ * When multiple proxy servers are involved in forwarding a request, each 
proxy can add its own
+ * Forwarded header to the request. This allows for the capture of information 
about each
+ * intermediate node that the request passes through.
+ * 
+ * In this implementation, the Forwarded header is added to the request by the 
`process` method. The
+ * method first retrieves the ProtocolVersion and URIAuthority from the 
HttpContext. The
+ * ProtocolVersion is used to determine the proto key value and the 
URIAuthority is used to
+ * determine the host and port key values. The method also retrieves the 
EndpointDetails and
+ * "X-Forwarded-For" header from the HttpContext, if they exist. The 
EndpointDetails is used to
+ * determine the for key value and the "X-Forwarded-For" header is used to 
determine the by key
+ * value. If the "X-Forwarded-For" header does not exist, the by key value is 
set to "unknown".
+ * 
+ * The Forwarded header is added to the request by calling the 
`HttpRequest.addHeader` method. If a
+ * Forwarded header already exists in the request, the new key-value pairs are 
appended to the
+ * existing header.
+ *
+ * @since 5.3
+ */
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
+public class ForwardedRequest implements HttpRequestInterceptor {
+
+/**
+ * The name of the header to set in the HTTP request.
+ */
+private static final String X_FORWARDED_HEADER_NAME = "X-Forwarded-For";
+
+/**
+ * The name of the header to set in the HTTP request.
+ */
+private static final String FORWARDED_HEADER_NAME = "Forwarded";
+
+
+/**
+ * Singleton instance.
+ */
+public static final HttpRequestInterceptor INSTANCE = new 
ForwardedRequest();
+
+
+/**
+ * Adds a Forwarded header to the specifie

[GitHub] [httpcomponents-core] ok2c commented on a diff in pull request #390: Add a "Forwarded" HttpRequestInterceptor to add the "Forwarded" HTTP header.

2023-02-14 Thread via GitHub


ok2c commented on code in PR #390:
URL: 
https://github.com/apache/httpcomponents-core/pull/390#discussion_r1105457831


##
httpcore5/src/main/java/org/apache/hc/core5/http/protocol/ForwardedRequest.java:
##
@@ -0,0 +1,159 @@
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+
+package org.apache.hc.core5.http.protocol;
+
+import java.io.IOException;
+
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EndpointDetails;
+import org.apache.hc.core5.http.EntityDetails;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpException;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpRequestInterceptor;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.ProtocolException;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.net.URIAuthority;
+import org.apache.hc.core5.util.Args;
+
+/**
+ * The ForwardedHeaderInterceptor class is a `HttpRequestInterceptor` that can 
be used to add the
+ * Forwarded header to an HTTP request. The Forwarded header is used to 
capture information about
+ * the intermediate nodes that a request has passed through. This information 
can be useful for
+ * security purposes or for debugging purposes.
+ * 
+ * The Forwarded header consists of a list of key-value pairs separated by 
semicolons. The keys that
+ * can be used in the Forwarded header include "host", "port", "proto", "for", 
and "by". The host
+ * key is used to specify the host name or IP address of the request 
authority. The port key is used
+ * to specify the port number of the request authority. The proto key is used 
to specify the
+ * protocol version of the request. The for key is used to specify the IP 
address of the client
+ * making the request. The by key is used to specify the IP address of the 
node adding the Forwarded
+ * header.
+ * 
+ * When multiple proxy servers are involved in forwarding a request, each 
proxy can add its own
+ * Forwarded header to the request. This allows for the capture of information 
about each
+ * intermediate node that the request passes through.
+ * 
+ * In this implementation, the Forwarded header is added to the request by the 
`process` method. The
+ * method first retrieves the ProtocolVersion and URIAuthority from the 
HttpContext. The
+ * ProtocolVersion is used to determine the proto key value and the 
URIAuthority is used to
+ * determine the host and port key values. The method also retrieves the 
EndpointDetails and
+ * "X-Forwarded-For" header from the HttpContext, if they exist. The 
EndpointDetails is used to
+ * determine the for key value and the "X-Forwarded-For" header is used to 
determine the by key
+ * value. If the "X-Forwarded-For" header does not exist, the by key value is 
set to "unknown".
+ * 
+ * The Forwarded header is added to the request by calling the 
`HttpRequest.addHeader` method. If a
+ * Forwarded header already exists in the request, the new key-value pairs are 
appended to the
+ * existing header.
+ *
+ * @since 5.3
+ */
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
+public class ForwardedRequest implements HttpRequestInterceptor {
+
+/**
+ * The name of the header to set in the HTTP request.
+ */
+private static final String X_FORWARDED_HEADER_NAME = "X-Forwarded-For";
+
+/**
+ * The name of the header to set in the HTTP request.
+ */
+private static final String FORWARDED_HEADER_NAME = "Forwarded";
+
+
+/**
+ * Singleton instance.
+ */
+public static final HttpRequestInterceptor INSTANCE = new 
ForwardedRequest();
+
+
+/**
+ * Adds a Forwarded header to the specified HTTP re

[GitHub] [httpcomponents-core] ok2c commented on pull request #390: Add a "Forwarded" HttpRequestInterceptor to add the "Forwarded" HTTP header.

2023-02-14 Thread via GitHub


ok2c commented on PR #390:
URL: 
https://github.com/apache/httpcomponents-core/pull/390#issuecomment-1430290363

   @arturobernalg One more thing. The javadocs say
   ```
The Forwarded header is added to the request by calling the 
`HttpRequest.addHeader` method. If a
Forwarded header already exists in the request, the new key-value pairs are 
appended to the
existing header.
```
   but this is not what the implementation currently does and I think it did 
not do that before, either. Is the interceptor meant to preserve the list of 
previous hops in the forwarded chain or it is meant to build the initial list 
consisting of the first hop only? Please clarify.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] arturobernalg commented on pull request #390: Add a "Forwarded" HttpRequestInterceptor to add the "Forwarded" HTTP header.

2023-02-14 Thread via GitHub


arturobernalg commented on PR #390:
URL: 
https://github.com/apache/httpcomponents-core/pull/390#issuecomment-1430330009

   > @arturobernalg One more thing. The javadocs say
   > 
   > ```
   >  The Forwarded header is added to the request by calling the 
`HttpRequest.addHeader` method. If a
   >  Forwarded header already exists in the request, the new key-value pairs 
are appended to the
   >  existing header.
   > ```
   > 
   > but this is not what the implementation currently does and I think it did 
not do that before, either. Is the interceptor meant to preserve the list of 
previous hops in the forwarded chain or it is meant to build the initial list 
consisting of the first hop only? Please clarify.
   
   @ok2c my mistake. the existing header is overwritten with the newly 
generated value


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] asfgit merged pull request #375: Use either US-ASCII or UTF-8 encoding for text where approriate

2023-02-14 Thread via GitHub


asfgit merged PR #375:
URL: https://github.com/apache/httpcomponents-core/pull/375


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on pull request #390: Add a "Forwarded" HttpRequestInterceptor to add the "Forwarded" HTTP header.

2023-02-15 Thread via GitHub


ok2c commented on PR #390:
URL: 
https://github.com/apache/httpcomponents-core/pull/390#issuecomment-1431744979

   @arturobernalg I am still not entirely sure I fully understand the intent of 
this interceptor. Is it meant to be used by (1) the client to populate the 
forwarded value for the very hop, by (2) the proxy to add one more hop to the 
existing list of hops, or by (3) both. At the moment the interceptor appears to 
be intended for the scenario 1 only, but in such a case I think it should not 
meddle if the `Forwarded` header if it has already been set by the caller.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c merged pull request #412: Updated NOTICE to 2023

2023-02-16 Thread via GitHub


ok2c merged PR #412:
URL: https://github.com/apache/httpcomponents-client/pull/412


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] hooyantsing opened a new pull request, #391: The official document POST example incorrectly calls the GET method

2023-02-17 Thread via GitHub


hooyantsing opened a new pull request, #391:
URL: https://github.com/apache/httpcomponents-core/pull/391

   The official document POST example incorrectly calls the GET method. For 
beginners, it is necessary to revise.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c merged pull request #391: The official document POST example incorrectly calls the GET method

2023-02-17 Thread via GitHub


ok2c merged PR #391:
URL: https://github.com/apache/httpcomponents-core/pull/391


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] alicejli opened a new pull request, #413: chore: update ClientProxyAuthenticationExample

2023-02-17 Thread via GitHub


alicejli opened a new pull request, #413:
URL: https://github.com/apache/httpcomponents-client/pull/413

   Update to the `ClientAuthenticationProxy` example to be runnable.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c merged pull request #413: chore: update ClientProxyAuthenticationExample

2023-02-17 Thread via GitHub


ok2c merged PR #413:
URL: https://github.com/apache/httpcomponents-client/pull/413


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] arturobernalg commented on pull request #390: Add a "Forwarded" HttpRequestInterceptor to add the "Forwarded" HTTP header.

2023-02-18 Thread via GitHub


arturobernalg commented on PR #390:
URL: 
https://github.com/apache/httpcomponents-core/pull/390#issuecomment-1435763945

   I did the necessary change to be complies to the RFC.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on a diff in pull request #390: Add a "Forwarded" HttpRequestInterceptor to add the "Forwarded" HTTP header.

2023-02-19 Thread via GitHub


ok2c commented on code in PR #390:
URL: 
https://github.com/apache/httpcomponents-core/pull/390#discussion_r211537


##
httpcore5/src/main/java/org/apache/hc/core5/http/protocol/ForwardedRequest.java:
##
@@ -0,0 +1,189 @@
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+
+package org.apache.hc.core5.http.protocol;
+
+import java.io.IOException;
+import java.net.Inet6Address;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EndpointDetails;
+import org.apache.hc.core5.http.EntityDetails;
+import org.apache.hc.core5.http.HttpException;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpRequestInterceptor;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.ProtocolException;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.net.URIAuthority;
+import org.apache.hc.core5.util.Args;
+
+/**
+ * The ForwardedRequest class is an implementation of the {@link 
HttpRequestInterceptor} interface
+ * that can be used by a proxy server to add a Forwarded header to an HTTP 
request. The Forwarded
+ * header is used to capture information about the intermediate nodes that a 
request has passed
+ * through. This information can be useful for security purposes or for 
debugging purposes.
+ * 
+ * The Forwarded header consists of a list of key-value pairs separated by 
semicolons. The keys that
+ * can be used in the Forwarded header include "host", "port", "proto", "for", 
and "by". The host
+ * key is used to specify the host name or IP address of the request 
authority. The port key is used
+ * to specify the port number of the request authority. The proto key is used 
to specify the
+ * protocol version of the request. The for key is used to specify the IP 
address of the client
+ * making the request. The by key is used to specify the IP address of the 
node adding the Forwarded
+ * header.
+ * 
+ * When multiple proxy servers are involved in forwarding a request, each 
proxy can add its own
+ * Forwarded header to the request. This allows for the capture of information 
about each
+ * intermediate node that the request passes through.
+ * 
+ * The ForwardedRequest class adds the Forwarded header to the request by 
implementing the process()
+ * method of the HttpRequestInterceptor interface. The method retrieves the 
ProtocolVersion and
+ * {@link URIAuthority} from the {@link HttpContext}. The ProtocolVersion is 
used to determine the
+ * proto key value and the {@link URIAuthority} is used to determine the host 
and port key values.
+ * The method also retrieves the {@link EndpointDetails} from the {@link 
HttpContext}, if it exists.
+ * The {@link EndpointDetails} is used to determine the by and for key values. 
If a Forwarded header
+ * already exists in the request, the existing header is not overwritten; 
instead, the new header
+ * value is appended to the existing header value, with a comma separator.
+ * 
+ * This implementation of the ForwardedRequest class is immutable and 
thread-safe.
+ *
+ * @since 5.3
+ */
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
+public class ForwardedRequest implements HttpRequestInterceptor {
+
+/**
+ * The name of the header to set in the HTTP request.
+ */
+private static final String FORWARDED_HEADER_NAME = "Forwarded";
+
+/**
+ * Singleton instance.
+ */
+public static final HttpRequestInterceptor INSTANCE = new 
ForwardedRequest();
+
+
+/**
+ * The process method adds a Forwarded header to an HTTP request 
containing information about
+ * the intermediate nodes that the request has passed through. If a 
Forwarded header a

[GitHub] [httpcomponents-core] arturobernalg commented on pull request #390: Add a "Forwarded" HttpRequestInterceptor to add the "Forwarded" HTTP header.

2023-02-19 Thread via GitHub


arturobernalg commented on PR #390:
URL: 
https://github.com/apache/httpcomponents-core/pull/390#issuecomment-1436048764

   HI @ok2c 
   I just commit all the change that you suggested.
   TY 


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on pull request #390: Add a "Forwarded" HttpRequestInterceptor to add the "Forwarded" HTTP header.

2023-02-20 Thread via GitHub


ok2c commented on PR #390:
URL: 
https://github.com/apache/httpcomponents-core/pull/390#issuecomment-1436996145

   @arturobernalg Almost there. Now consider the case when the 
`EndpointDetails` is null (not present in the execution context). What 
`forwarded` value would the interceptor produce? Please make sure that your 
code either adds a valid header, throws an exception or does nothing. It should 
never produce a malformed header no matter circumstances. A test case for the 
`EndpointDetails` being null would also be nice.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] arturobernalg commented on pull request #390: Add a "Forwarded" HttpRequestInterceptor to add the "Forwarded" HTTP header.

2023-02-20 Thread via GitHub


arturobernalg commented on PR #390:
URL: 
https://github.com/apache/httpcomponents-core/pull/390#issuecomment-1437551170

   > @arturobernalg Almost there. Now consider the case when the 
`EndpointDetails` is null (not present in the execution context). What 
`forwarded` value would the interceptor produce? Please make sure that your 
code either adds a valid header, throws an exception or does nothing. It should 
never produce a malformed header no matter circumstances. A test case for the 
`EndpointDetails` being null would also be nice.
   
   @ok2c  done


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c merged pull request #390: Add a "Forwarded" HttpRequestInterceptor to add the "Forwarded" HTTP header.

2023-02-21 Thread via GitHub


ok2c merged PR #390:
URL: https://github.com/apache/httpcomponents-core/pull/390


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] jkmcl opened a new pull request, #392: Hygiene changes to Deadline

2023-02-22 Thread via GitHub


jkmcl opened a new pull request, #392:
URL: https://github.com/apache/httpcomponents-core/pull/392

   Since this is the v5.3 branch which is in alpha stage, is it fine to break 
binary compatibility by making Deadline.MIN_VALUE and Deadline.MAX_VALUE final 
and removing the checked exception from Deadline.parse since it cannot be 
thrown from the method body?
   
   For context regarding MIN_VALUE/MAX_VALUE: 
https://github.com/apache/httpcomponents-core/pull/355
   
   Thanks.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c closed pull request #414: Hygiene - remove unused private fields

2023-02-23 Thread via GitHub


ok2c closed pull request #414: Hygiene - remove unused private fields
URL: https://github.com/apache/httpcomponents-client/pull/414


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c commented on pull request #414: Hygiene - remove unused private fields

2023-02-23 Thread via GitHub


ok2c commented on PR #414:
URL: 
https://github.com/apache/httpcomponents-client/pull/414#issuecomment-1441632884

   @jkmcl It cannot be done until 6.0.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c merged pull request #414: Hygiene - remove unused private fields

2023-02-23 Thread via GitHub


ok2c merged PR #414:
URL: https://github.com/apache/httpcomponents-client/pull/414


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] dependabot[bot] opened a new pull request, #415: Bump log4j.version from 2.19.0 to 2.20.0

2023-02-24 Thread via GitHub


dependabot[bot] opened a new pull request, #415:
URL: https://github.com/apache/httpcomponents-client/pull/415

   Bumps `log4j.version` from 2.19.0 to 2.20.0.
   Updates `log4j-slf4j-impl` from 2.19.0 to 2.20.0
   
   Commits
   
   https://github.com/apache/logging-log4j2/commit/44ab0131718fc8d1fcb45604b0f1a8187765910d";>44ab013
 [maven-release-plugin] prepare release log4j-2.20.0-rc1
   https://github.com/apache/logging-log4j2/commit/ffa25f1dc216405351ed8d01e74d5242be3d9782";>ffa25f1
 Skip spotless plugin during release
   https://github.com/apache/logging-log4j2/commit/7c4e69f36030bee536044a2bd2ee84bcf261b673";>7c4e69f
 [maven-release-plugin] rollback the release of log4j-2.20.0-rc1
   https://github.com/apache/logging-log4j2/commit/6825e26da6d8cb473b8c1707c3d623d6589808f4";>6825e26
 [maven-release-plugin] prepare for next development iteration
   https://github.com/apache/logging-log4j2/commit/68d0bab94ade190bce90b6347663cfd63bcc6129";>68d0bab
 [maven-release-plugin] prepare release log4j-2.20.0-rc1
   https://github.com/apache/logging-log4j2/commit/763b844fbd0e2437cebb25887b1ba8530d70d390";>763b844
 Revert version update
   https://github.com/apache/logging-log4j2/commit/c3e8696f51ba4cae5dda27059d181a7598b041cf";>c3e8696
 [maven-release-plugin] prepare release log4j-2.20.1-rc1
   https://github.com/apache/logging-log4j2/commit/c54126819c2c29abb6759eaea8f2fc95ea295566";>c541268
 [maven-release-plugin] prepare for next development iteration
   https://github.com/apache/logging-log4j2/commit/903547c3c7e061005618daeedd16c56facce7dd3";>903547c
 [maven-release-plugin] prepare release log4j-2.20.1-rc1
   https://github.com/apache/logging-log4j2/commit/090af6d7db4671a4c22a78d0fde142251da9e1ff";>090af6d
 Add test jars
   Additional commits viewable in https://github.com/apache/logging-log4j2/compare/rel/2.19.0...rel/2.20.0";>compare
 view
   
   
   
   
   Updates `log4j-core` from 2.19.0 to 2.20.0
   
   Commits
   
   https://github.com/apache/logging-log4j2/commit/44ab0131718fc8d1fcb45604b0f1a8187765910d";>44ab013
 [maven-release-plugin] prepare release log4j-2.20.0-rc1
   https://github.com/apache/logging-log4j2/commit/ffa25f1dc216405351ed8d01e74d5242be3d9782";>ffa25f1
 Skip spotless plugin during release
   https://github.com/apache/logging-log4j2/commit/7c4e69f36030bee536044a2bd2ee84bcf261b673";>7c4e69f
 [maven-release-plugin] rollback the release of log4j-2.20.0-rc1
   https://github.com/apache/logging-log4j2/commit/6825e26da6d8cb473b8c1707c3d623d6589808f4";>6825e26
 [maven-release-plugin] prepare for next development iteration
   https://github.com/apache/logging-log4j2/commit/68d0bab94ade190bce90b6347663cfd63bcc6129";>68d0bab
 [maven-release-plugin] prepare release log4j-2.20.0-rc1
   https://github.com/apache/logging-log4j2/commit/763b844fbd0e2437cebb25887b1ba8530d70d390";>763b844
 Revert version update
   https://github.com/apache/logging-log4j2/commit/c3e8696f51ba4cae5dda27059d181a7598b041cf";>c3e8696
 [maven-release-plugin] prepare release log4j-2.20.1-rc1
   https://github.com/apache/logging-log4j2/commit/c54126819c2c29abb6759eaea8f2fc95ea295566";>c541268
 [maven-release-plugin] prepare for next development iteration
   https://github.com/apache/logging-log4j2/commit/903547c3c7e061005618daeedd16c56facce7dd3";>903547c
 [maven-release-plugin] prepare release log4j-2.20.1-rc1
   https://github.com/apache/logging-log4j2/commit/090af6d7db4671a4c22a78d0fde142251da9e1ff";>090af6d
 Add test jars
   Additional commits viewable in https://github.com/apache/logging-log4j2/compare/rel/2.19.0...rel/2.20.0";>compare
 view
   
   
   
   
   
   Dependabot will resolve any conflicts with this PR as long as you don't 
alter it yourself. You can also trigger a rebase manually by commenting 
`@dependabot rebase`.
   
   [//]: # (dependabot-automerge-start)
   [//]: # (dependabot-automerge-end)
   
   ---
   
   
   Dependabot commands and options
   
   
   You can trigger Dependabot actions by commenting on this PR:
   - `@dependabot rebase` will rebase this PR
   - `@dependabot recreate` will recreate this PR, overwriting any edits that 
have been made to it
   - `@dependabot merge` will merge this PR after your CI passes on it
   - `@dependabot squash and merge` will squash and merge this PR after your CI 
passes on it
   - `@dependabot cancel merge` will cancel a previously requested merge and 
block automerging
   - `@dependabot reopen` will reopen this PR if it is closed
   - `@dependabot close` will close this PR and stop Dependabot recreating it. 
You can achieve the same result by closing it manually
   - `@dependabot ignore this major version` will close this PR and stop 
Dependabot creating any more for this major version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this minor version` will close this PR and stop 
Dependabot creating any more for this minor version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this dependency` will c

[GitHub] [httpcomponents-core] dependabot[bot] opened a new pull request, #393: Bump log4j.version from 2.19.0 to 2.20.0

2023-02-24 Thread via GitHub


dependabot[bot] opened a new pull request, #393:
URL: https://github.com/apache/httpcomponents-core/pull/393

   Bumps `log4j.version` from 2.19.0 to 2.20.0.
   Updates `log4j-slf4j-impl` from 2.19.0 to 2.20.0
   
   Commits
   
   https://github.com/apache/logging-log4j2/commit/44ab0131718fc8d1fcb45604b0f1a8187765910d";>44ab013
 [maven-release-plugin] prepare release log4j-2.20.0-rc1
   https://github.com/apache/logging-log4j2/commit/ffa25f1dc216405351ed8d01e74d5242be3d9782";>ffa25f1
 Skip spotless plugin during release
   https://github.com/apache/logging-log4j2/commit/7c4e69f36030bee536044a2bd2ee84bcf261b673";>7c4e69f
 [maven-release-plugin] rollback the release of log4j-2.20.0-rc1
   https://github.com/apache/logging-log4j2/commit/6825e26da6d8cb473b8c1707c3d623d6589808f4";>6825e26
 [maven-release-plugin] prepare for next development iteration
   https://github.com/apache/logging-log4j2/commit/68d0bab94ade190bce90b6347663cfd63bcc6129";>68d0bab
 [maven-release-plugin] prepare release log4j-2.20.0-rc1
   https://github.com/apache/logging-log4j2/commit/763b844fbd0e2437cebb25887b1ba8530d70d390";>763b844
 Revert version update
   https://github.com/apache/logging-log4j2/commit/c3e8696f51ba4cae5dda27059d181a7598b041cf";>c3e8696
 [maven-release-plugin] prepare release log4j-2.20.1-rc1
   https://github.com/apache/logging-log4j2/commit/c54126819c2c29abb6759eaea8f2fc95ea295566";>c541268
 [maven-release-plugin] prepare for next development iteration
   https://github.com/apache/logging-log4j2/commit/903547c3c7e061005618daeedd16c56facce7dd3";>903547c
 [maven-release-plugin] prepare release log4j-2.20.1-rc1
   https://github.com/apache/logging-log4j2/commit/090af6d7db4671a4c22a78d0fde142251da9e1ff";>090af6d
 Add test jars
   Additional commits viewable in https://github.com/apache/logging-log4j2/compare/rel/2.19.0...rel/2.20.0";>compare
 view
   
   
   
   
   Updates `log4j-core` from 2.19.0 to 2.20.0
   
   Commits
   
   https://github.com/apache/logging-log4j2/commit/44ab0131718fc8d1fcb45604b0f1a8187765910d";>44ab013
 [maven-release-plugin] prepare release log4j-2.20.0-rc1
   https://github.com/apache/logging-log4j2/commit/ffa25f1dc216405351ed8d01e74d5242be3d9782";>ffa25f1
 Skip spotless plugin during release
   https://github.com/apache/logging-log4j2/commit/7c4e69f36030bee536044a2bd2ee84bcf261b673";>7c4e69f
 [maven-release-plugin] rollback the release of log4j-2.20.0-rc1
   https://github.com/apache/logging-log4j2/commit/6825e26da6d8cb473b8c1707c3d623d6589808f4";>6825e26
 [maven-release-plugin] prepare for next development iteration
   https://github.com/apache/logging-log4j2/commit/68d0bab94ade190bce90b6347663cfd63bcc6129";>68d0bab
 [maven-release-plugin] prepare release log4j-2.20.0-rc1
   https://github.com/apache/logging-log4j2/commit/763b844fbd0e2437cebb25887b1ba8530d70d390";>763b844
 Revert version update
   https://github.com/apache/logging-log4j2/commit/c3e8696f51ba4cae5dda27059d181a7598b041cf";>c3e8696
 [maven-release-plugin] prepare release log4j-2.20.1-rc1
   https://github.com/apache/logging-log4j2/commit/c54126819c2c29abb6759eaea8f2fc95ea295566";>c541268
 [maven-release-plugin] prepare for next development iteration
   https://github.com/apache/logging-log4j2/commit/903547c3c7e061005618daeedd16c56facce7dd3";>903547c
 [maven-release-plugin] prepare release log4j-2.20.1-rc1
   https://github.com/apache/logging-log4j2/commit/090af6d7db4671a4c22a78d0fde142251da9e1ff";>090af6d
 Add test jars
   Additional commits viewable in https://github.com/apache/logging-log4j2/compare/rel/2.19.0...rel/2.20.0";>compare
 view
   
   
   
   
   
   Dependabot will resolve any conflicts with this PR as long as you don't 
alter it yourself. You can also trigger a rebase manually by commenting 
`@dependabot rebase`.
   
   [//]: # (dependabot-automerge-start)
   [//]: # (dependabot-automerge-end)
   
   ---
   
   
   Dependabot commands and options
   
   
   You can trigger Dependabot actions by commenting on this PR:
   - `@dependabot rebase` will rebase this PR
   - `@dependabot recreate` will recreate this PR, overwriting any edits that 
have been made to it
   - `@dependabot merge` will merge this PR after your CI passes on it
   - `@dependabot squash and merge` will squash and merge this PR after your CI 
passes on it
   - `@dependabot cancel merge` will cancel a previously requested merge and 
block automerging
   - `@dependabot reopen` will reopen this PR if it is closed
   - `@dependabot close` will close this PR and stop Dependabot recreating it. 
You can achieve the same result by closing it manually
   - `@dependabot ignore this major version` will close this PR and stop 
Dependabot creating any more for this major version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this minor version` will close this PR and stop 
Dependabot creating any more for this minor version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this dependency` will clo

[GitHub] [httpcomponents-core] arturobernalg opened a new pull request, #394: Add support for Internationalized Domain Names (IDN)

2023-02-24 Thread via GitHub


arturobernalg opened a new pull request, #394:
URL: https://github.com/apache/httpcomponents-core/pull/394

   Improve IDN support in URI parsing by converting non-ASCII characters to 
their ASCII-compatible form using the java.net.IDN class. This allows for 
better interoperability with systems that may not support Unicode characters in 
domain names. The change was made by adding a conditional statement that checks 
if the hostname contains non-ASCII characters, and if so, applies the IDN 
conversion. The existing code uses the Apache Tomcat URI parsing implementation 
for compatibility and consistency with Tomcat's behavior. This change should 
have no impact on ASCII-only hostnames.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on a diff in pull request #394: Add support for Internationalized Domain Names (IDN)

2023-02-24 Thread via GitHub


ok2c commented on code in PR #394:
URL: 
https://github.com/apache/httpcomponents-core/pull/394#discussion_r1117710747


##
httpcore5/src/main/java/org/apache/hc/core5/util/TextUtils.java:
##
@@ -141,4 +141,22 @@ public static String toLowerCase(final String s) {
 return s.toLowerCase(Locale.ROOT);
 }
 
+
+/**
+ * Determines whether the given string contains only ASCII characters.
+ *
+ * @param s the string to check
+ * @return true if the string contains only ASCII characters, false 
otherwise
+ * @throws IllegalArgumentException if the input string is null
+ * @since 5.3
+ */
+public static boolean isAllASCII(final String s) {

Review Comment:
   @arturobernalg Please make the new method use `CharSequence` as a parameter 
instead of `String`.



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] arturobernalg commented on a diff in pull request #394: Add support for Internationalized Domain Names (IDN)

2023-02-24 Thread via GitHub


arturobernalg commented on code in PR #394:
URL: 
https://github.com/apache/httpcomponents-core/pull/394#discussion_r1117720198


##
httpcore5/src/main/java/org/apache/hc/core5/util/TextUtils.java:
##
@@ -141,4 +141,22 @@ public static String toLowerCase(final String s) {
 return s.toLowerCase(Locale.ROOT);
 }
 
+
+/**
+ * Determines whether the given string contains only ASCII characters.
+ *
+ * @param s the string to check
+ * @return true if the string contains only ASCII characters, false 
otherwise
+ * @throws IllegalArgumentException if the input string is null
+ * @since 5.3
+ */
+public static boolean isAllASCII(final String s) {

Review Comment:
   done.



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] arturobernalg commented on pull request #394: Add support for Internationalized Domain Names (IDN)

2023-02-24 Thread via GitHub


arturobernalg commented on PR #394:
URL: 
https://github.com/apache/httpcomponents-core/pull/394#issuecomment-1444581097

   I just change the branch base to 5.3.x and use CharSequence instead


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c merged pull request #394: Add support for Internationalized Domain Names (IDN)

2023-02-25 Thread via GitHub


ok2c merged PR #394:
URL: https://github.com/apache/httpcomponents-core/pull/394


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c merged pull request #416: Remove dependency not used

2023-02-25 Thread via GitHub


ok2c merged PR #416:
URL: https://github.com/apache/httpcomponents-client/pull/416


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on pull request #392: Hygiene changes to Deadline

2023-02-25 Thread via GitHub


ok2c commented on PR #392:
URL: 
https://github.com/apache/httpcomponents-core/pull/392#issuecomment-1445031389

   @jkmcl This cannot be done until 6.0.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c closed pull request #392: Hygiene changes to Deadline

2023-02-25 Thread via GitHub


ok2c closed pull request #392: Hygiene changes to Deadline
URL: https://github.com/apache/httpcomponents-core/pull/392


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] arturobernalg opened a new pull request, #417: Fix Heuristic caching for URIs with query strings by adhering to RFC …

2023-02-27 Thread via GitHub


arturobernalg opened a new pull request, #417:
URL: https://github.com/apache/httpcomponents-client/pull/417

   This pull request addresses the issue where heuristic caching was not 
working for URIs with query strings. The problem arises from Section 13.9 of 
RFC 2616, which prohibits caches from treating responses to such URIs as fresh 
unless the server provides an explicit expiration time.
   
   However, as noted in Section 4.2.2 of RFC 7234, this prohibition has not 
been widely implemented, and origin servers are encouraged to send explicit 
directives if they wish to preclude caching.
   
   The current implementation of the module adheres to the safe interpretation 
of RFC 2616 and does not cache responses to URIs with query strings. However, 
it would be possible to introduce a configuration option that relaxed this 
rule, in line with the updated RFC 7234.
   
   This pull request introduces the configuration option 
neverCacheHTTP11ResponsesWithQuery, which determines whether HTTP/1.1 responses 
with query strings should never be cached by the client. By default, caching of 
such responses is allowed, but enabling this option may improve security by 
preventing responses with sensitive information from being cached.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] arturobernalg opened a new pull request, #418: Fix issue with LLv6 literals in URLs

2023-02-28 Thread via GitHub


arturobernalg opened a new pull request, #418:
URL: https://github.com/apache/httpcomponents-client/pull/418

   This pull request addresses issue LLv6 literals in URLs, where LLv6 literals 
in URLs are not properly handled by HttpClient due to a limitation in the Java 
standard method InetAddress.getAllByName(host). Specifically, when constructing 
a URL with an LLv6 literal, the % sign that prefixes the ZoneID must be quoted 
as %25 according to RFC 6874. However, HttpClient does not support quoted host 
literals.
   
   To work around this limitation, this pull request modifies the 
SystemDefaultDnsResolver class to strip the IPv6 zone identifier from the host 
string before calling InetAddress.getAllByName(host). This allows HttpClient to 
handle LLv6 literals in URLs that conform to RFC 6874.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c commented on a diff in pull request #418: Fix issue with LLv6 literals in URLs

2023-03-01 Thread via GitHub


ok2c commented on code in PR #418:
URL: 
https://github.com/apache/httpcomponents-client/pull/418#discussion_r1121977585


##
httpclient5/src/main/java/org/apache/hc/client5/http/SystemDefaultDnsResolver.java:
##
@@ -40,7 +40,14 @@ public class SystemDefaultDnsResolver implements DnsResolver 
{
 
 @Override
 public InetAddress[] resolve(final String host) throws 
UnknownHostException {
-return InetAddress.getAllByName(host);
+try {

Review Comment:
   @arturobernalg This approach has a substantial drawback: DNS lookup failures 
completely unrelated to LLv6 will not generate two DNS queries. For some 
applications it may be not a big deal but for some it may. What is the problem 
with always calling `#stripsIPv6ZoneId` prior to calling 
`InetAddress#getAllByName`?



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] arturobernalg commented on a diff in pull request #418: Fix issue with LLv6 literals in URLs

2023-03-01 Thread via GitHub


arturobernalg commented on code in PR #418:
URL: 
https://github.com/apache/httpcomponents-client/pull/418#discussion_r119616


##
httpclient5/src/main/java/org/apache/hc/client5/http/SystemDefaultDnsResolver.java:
##
@@ -40,7 +40,14 @@ public class SystemDefaultDnsResolver implements DnsResolver 
{
 
 @Override
 public InetAddress[] resolve(final String host) throws 
UnknownHostException {
-return InetAddress.getAllByName(host);
+try {

Review Comment:
   The reason why we don't want to call stripsIPv6ZoneId all the time is that 
it involves additional processing and may not be necessary for hostnames that 
are not LLv6. This additional processing can cause a slight delay in the 
overall execution time of the resolve method.
   In addition, if we always call stripsIPv6ZoneId before calling 
InetAddress.getAllByName, it means that we will be making two DNS queries for 
every hostname, even those that are not LLv6. This can result in unnecessary 
network traffic and may cause performance issues in certain environments.
   Therefore, the approach of only calling stripsIPv6ZoneId when a 
UnknownHostException is caught and the hostname is an LLv6 address is a more 
targeted and efficient solution.



##
httpclient5/src/main/java/org/apache/hc/client5/http/SystemDefaultDnsResolver.java:
##
@@ -40,7 +40,14 @@ public class SystemDefaultDnsResolver implements DnsResolver 
{
 
 @Override
 public InetAddress[] resolve(final String host) throws 
UnknownHostException {
-return InetAddress.getAllByName(host);
+try {

Review Comment:
   HI @ok2c 
   The reason why we don't want to call stripsIPv6ZoneId all the time is that 
it involves additional processing and may not be necessary for hostnames that 
are not LLv6. This additional processing can cause a slight delay in the 
overall execution time of the resolve method.
   In addition, if we always call stripsIPv6ZoneId before calling 
InetAddress.getAllByName, it means that we will be making two DNS queries for 
every hostname, even those that are not LLv6. This can result in unnecessary 
network traffic and may cause performance issues in certain environments.
   Therefore, the approach of only calling stripsIPv6ZoneId when a 
UnknownHostException is caught and the hostname is an LLv6 address is a more 
targeted and efficient solution.



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c commented on a diff in pull request #418: Fix issue with LLv6 literals in URLs

2023-03-01 Thread via GitHub


ok2c commented on code in PR #418:
URL: 
https://github.com/apache/httpcomponents-client/pull/418#discussion_r1122259452


##
httpclient5/src/main/java/org/apache/hc/client5/http/SystemDefaultDnsResolver.java:
##
@@ -40,7 +40,14 @@ public class SystemDefaultDnsResolver implements DnsResolver 
{
 
 @Override
 public InetAddress[] resolve(final String host) throws 
UnknownHostException {
-return InetAddress.getAllByName(host);
+try {

Review Comment:
   @arturobernalg Repeating the same DNS query with the same input makes no 
sense and a lot of folks will be upset due to unnecessary execution costs. 
Please make sure the second query gets executed only if anything got stripped 
and the input is not the same



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] arturobernalg commented on a diff in pull request #418: Fix issue with LLv6 literals in URLs

2023-03-01 Thread via GitHub


arturobernalg commented on code in PR #418:
URL: 
https://github.com/apache/httpcomponents-client/pull/418#discussion_r1122275420


##
httpclient5/src/main/java/org/apache/hc/client5/http/SystemDefaultDnsResolver.java:
##
@@ -40,7 +40,14 @@ public class SystemDefaultDnsResolver implements DnsResolver 
{
 
 @Override
 public InetAddress[] resolve(final String host) throws 
UnknownHostException {
-return InetAddress.getAllByName(host);
+try {

Review Comment:
   @ok2c That's a valid point.
   Changed.
   TY



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c commented on a diff in pull request #418: Fix issue with LLv6 literals in URLs

2023-03-02 Thread via GitHub


ok2c commented on code in PR #418:
URL: 
https://github.com/apache/httpcomponents-client/pull/418#discussion_r1123306774


##
httpclient5/src/test/java/org/apache/hc/client5/http/SystemDefaultDnsResolverTest.java:
##
@@ -0,0 +1,68 @@
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+package org.apache.hc.client5.http;
+
+import org.junit.jupiter.api.Test;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class SystemDefaultDnsResolverTest {
+
+@Test
+void resolve() throws UnknownHostException {
+final SystemDefaultDnsResolver resolver = 
SystemDefaultDnsResolver.INSTANCE;
+
+final InetAddress[] result1 = resolver.resolve("example.com");

Review Comment:
   @arturobernalg While extra test coverage is nice, in this particular case 
these tests introduce dependency on DNS infrastructure with public network 
access. These tests may fail when run in a private network where 'example.com' 
does not resolve. Please re-write the tests that do not require public network 
access or remote them.



##
httpclient5/src/main/java/org/apache/hc/client5/http/SystemDefaultDnsResolver.java:
##
@@ -40,7 +40,14 @@ public class SystemDefaultDnsResolver implements DnsResolver 
{
 
 @Override
 public InetAddress[] resolve(final String host) throws 
UnknownHostException {
-return InetAddress.getAllByName(host);
+try {

Review Comment:
   @arturobernalg I suggest `#stripsIPv6ZoneId` be inlined as it is not being 
used anywhere else and extra hostname comparison be eliminated.



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] arturobernalg commented on pull request #418: Fix issue with LLv6 literals in URLs

2023-03-02 Thread via GitHub


arturobernalg commented on PR #418:
URL: 
https://github.com/apache/httpcomponents-client/pull/418#issuecomment-1452512057

   HI @ok2c 
   Even though I don't fully agree with putting logic in the catch block, I 
made the change. I believe it's better to keep it separate."
   TY


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] dependabot[bot] opened a new pull request, #395: Bump docker-maven-plugin from 0.31.0 to 0.42.0

2023-03-03 Thread via GitHub


dependabot[bot] opened a new pull request, #395:
URL: https://github.com/apache/httpcomponents-core/pull/395

   Bumps 
[docker-maven-plugin](https://github.com/fabric8io/docker-maven-plugin) from 
0.31.0 to 0.42.0.
   
   Release notes
   Sourced from https://github.com/fabric8io/docker-maven-plugin/releases";>docker-maven-plugin's
 releases.
   
   v0.42.0 (2023-02-28)
   
   Support docker run --platform (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1641";>1641)
 https://github.com/chonton";>@​chonton
   Update buildx documentation to amplify the build behavior (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1646";>1646)
 https://github.com/chonton";>@​chonton
   Default to native platform when creating container (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1645";>1645)
 https://github.com/chonton";>@​chonton
   JIB ignores the DOCKER_REGISTRY environment variable (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1617";>1617)
 https://github.com/rohanKanojia";>@​rohanKanojia
   
   0.41.0 (2023-02-06):
   
   multi-arch build should use provided repository (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1597";>1597)
 https://github.com/merikan";>@​merikan
   new property docker.build.network to override the network 
for RUN directives for docker build (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1636";>1636)
 https://github.com/tulinkry";>@​tulinkry
   Update Jib Core to v0.23.0 (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1637";>1637)
 https://github.com/rohanKanojia";>@​rohanKanojia
   Update JNR UnixSocket to v0.38.19 (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1638";>1638)
 https://github.com/rohanKanojia";>@​rohanKanojia
   
   0.40.3 (2022-12-18)
   
   image/squash option is taken into account when using buildx (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1605";>1605)
 https://github.com/kevinleturc";>@​kevinleturc
   Allow having build args with same name but different value in various 
sources, which are overriden in the order of precedence in resulting build args 
map (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1407";>1407)
 https://github.com/pavelsmolensky";>@​pavelsmolensky
   Use double for docker.cpus property and interpret this 
value in the same way as Docker config option --cpus (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1609";>1609)
 https://github.com/vjuranek";>@​vjuranek
   NPE from Assembly plugin when POM packaging is used (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1146";>1146)
 https://github.com/slawekjaranowski";>@​slawekjaranowski
   Docker pulling progress only shown after pull has completed and not in 
real-time (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1598";>1598)
 https://github.com/causalnet";>@​causalnet
   Bump org.yaml:snakeyaml to v1.32 (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1619";>1619)
 https://github.com/pen4";>@​pen4
   Bump com.google.cloud.tools:jib-core to v0.23.0 (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1620";>1620)
 https://github.com/pen4";>@​pen4
   Bump com.google.guava:guava to v31.1-jre https://github.com/rohanKanojia";>@​rohanKanojia
   
   0.40.2 (2022-07-31)
   
   Plugin doesn't abort building an image in case Podman is used and 
Dockerfile can't be processed (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1512";>1562)
 https://github.com/jh-cd";>@​jh-cd
   Bump gson from 2.8.5 to 2.8.9 (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1556";>1556)
 https://github.com/dependabot";>@​dependabot
   Build and load native platform during build goal, build and push all 
platforms during push goal (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1576";>1576)
 https://github.com/chonton";>@​chonton
   Remove buildx cache, don't delete builder instances after goal. Use 
builder instance to cache artifacts (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/pull/1579";>1579)
 https://github.com/chonton";>@​chonton
   Multiple assemblies use the name "maven". Please assign each 
assembly a unique name (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1558";>1558)
 https://github.com/tbfky";>@​tbfky
   Use https://index.docker.io/v1/ as default buildx server 
registry (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1574";>1574)
 https://github.com/chonton";>@​chonton
   When using buildx, do not force build of native platform  (https://github-redirect.dependabot.com/fabric8io/docker-maven-plugin/issues/1572";>1572)
 https://github.com/chonton";

[GitHub] [httpcomponents-core] dependabot[bot] closed pull request #389: Bump docker-maven-plugin from 0.31.0 to 0.41.0

2023-03-03 Thread via GitHub


dependabot[bot] closed pull request #389: Bump docker-maven-plugin from 0.31.0 
to 0.41.0
URL: https://github.com/apache/httpcomponents-core/pull/389


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] dependabot[bot] commented on pull request #389: Bump docker-maven-plugin from 0.31.0 to 0.41.0

2023-03-03 Thread via GitHub


dependabot[bot] commented on PR #389:
URL: 
https://github.com/apache/httpcomponents-core/pull/389#issuecomment-1453655727

   Superseded by #395.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c commented on a diff in pull request #418: Fix issue with LLv6 literals in URLs

2023-03-03 Thread via GitHub


ok2c commented on code in PR #418:
URL: 
https://github.com/apache/httpcomponents-client/pull/418#discussion_r1124684449


##
httpclient5/src/main/java/org/apache/hc/client5/http/SystemDefaultDnsResolver.java:
##
@@ -40,7 +40,23 @@ public class SystemDefaultDnsResolver implements DnsResolver 
{
 
 @Override
 public InetAddress[] resolve(final String host) throws 
UnknownHostException {
-return InetAddress.getAllByName(host);
+try {
+// Try resolving using the default resolver
+return InetAddress.getAllByName(host);
+} catch (final UnknownHostException e) {
+// If default resolver fails, try stripping the IPv6 zone ID and 
resolving again
+String strippedHost = host;
+if (host.charAt(0) == '[') {
+final int i = host.lastIndexOf('%');
+if (i != -1) {
+strippedHost = host.substring(0, i) + "]";
+}
+}
+if (!strippedHost.equals(host)) {

Review Comment:
   @arturobernalg The whole point of inlining the method was to avoid this 
extra comparison! Please use a boolean variable instead or set `strippedHost` 
by default.



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c commented on a diff in pull request #418: Fix issue with LLv6 literals in URLs

2023-03-03 Thread via GitHub


ok2c commented on code in PR #418:
URL: 
https://github.com/apache/httpcomponents-client/pull/418#discussion_r1124684449


##
httpclient5/src/main/java/org/apache/hc/client5/http/SystemDefaultDnsResolver.java:
##
@@ -40,7 +40,23 @@ public class SystemDefaultDnsResolver implements DnsResolver 
{
 
 @Override
 public InetAddress[] resolve(final String host) throws 
UnknownHostException {
-return InetAddress.getAllByName(host);
+try {
+// Try resolving using the default resolver
+return InetAddress.getAllByName(host);
+} catch (final UnknownHostException e) {
+// If default resolver fails, try stripping the IPv6 zone ID and 
resolving again
+String strippedHost = host;
+if (host.charAt(0) == '[') {
+final int i = host.lastIndexOf('%');
+if (i != -1) {
+strippedHost = host.substring(0, i) + "]";
+}
+}
+if (!strippedHost.equals(host)) {

Review Comment:
   @arturobernalg The whole point of inlining the method was to avoid this 
extra comparison! Please use a boolean variable instead or set `strippedHost` 
to `null` by default!



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c commented on pull request #417: Fix Heuristic caching for URIs with query strings by adhering to RFC …

2023-03-03 Thread via GitHub


ok2c commented on PR #417:
URL: 
https://github.com/apache/httpcomponents-client/pull/417#issuecomment-1453773882

   If there are no objections or other reviews I will merge this PR in a day or 
two.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c commented on a diff in pull request #418: Fix issue with LLv6 literals in URLs

2023-03-03 Thread via GitHub


ok2c commented on code in PR #418:
URL: 
https://github.com/apache/httpcomponents-client/pull/418#discussion_r1124702424


##
httpclient5/src/main/java/org/apache/hc/client5/http/SystemDefaultDnsResolver.java:
##
@@ -40,7 +40,23 @@ public class SystemDefaultDnsResolver implements DnsResolver 
{
 
 @Override
 public InetAddress[] resolve(final String host) throws 
UnknownHostException {
-return InetAddress.getAllByName(host);
+try {
+// Try resolving using the default resolver
+return InetAddress.getAllByName(host);
+} catch (final UnknownHostException e) {
+// If default resolver fails, try stripping the IPv6 zone ID and 
resolving again
+String strippedHost = host;
+if (host.charAt(0) == '[') {
+final int i = host.lastIndexOf('%');
+if (i != -1) {
+strippedHost = host.substring(0, i) + "]";
+}
+}
+if (!strippedHost.equals(host)) {

Review Comment:
   @arturobernalg In fact if you use null to signify a case when the original 
host is unchanged (not stripped) and no second DNS is not needed you can put 
this code into a separate method as before, if you like it better that way.  



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] arturobernalg commented on a diff in pull request #418: Fix issue with LLv6 literals in URLs

2023-03-03 Thread via GitHub


arturobernalg commented on code in PR #418:
URL: 
https://github.com/apache/httpcomponents-client/pull/418#discussion_r1124799194


##
httpclient5/src/main/java/org/apache/hc/client5/http/SystemDefaultDnsResolver.java:
##
@@ -40,7 +40,23 @@ public class SystemDefaultDnsResolver implements DnsResolver 
{
 
 @Override
 public InetAddress[] resolve(final String host) throws 
UnknownHostException {
-return InetAddress.getAllByName(host);
+try {
+// Try resolving using the default resolver
+return InetAddress.getAllByName(host);
+} catch (final UnknownHostException e) {
+// If default resolver fails, try stripping the IPv6 zone ID and 
resolving again
+String strippedHost = host;
+if (host.charAt(0) == '[') {
+final int i = host.lastIndexOf('%');
+if (i != -1) {
+strippedHost = host.substring(0, i) + "]";
+}
+}
+if (!strippedHost.equals(host)) {

Review Comment:
    @ok2c  would you mind give me an example? had chased some many time 
this  method 



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c commented on a diff in pull request #418: Fix issue with LLv6 literals in URLs

2023-03-03 Thread via GitHub


ok2c commented on code in PR #418:
URL: 
https://github.com/apache/httpcomponents-client/pull/418#discussion_r1124887617


##
httpclient5/src/main/java/org/apache/hc/client5/http/SystemDefaultDnsResolver.java:
##
@@ -40,7 +40,23 @@ public class SystemDefaultDnsResolver implements DnsResolver 
{
 
 @Override
 public InetAddress[] resolve(final String host) throws 
UnknownHostException {
-return InetAddress.getAllByName(host);
+try {
+// Try resolving using the default resolver
+return InetAddress.getAllByName(host);
+} catch (final UnknownHostException e) {
+// If default resolver fails, try stripping the IPv6 zone ID and 
resolving again
+String strippedHost = host;
+if (host.charAt(0) == '[') {
+final int i = host.lastIndexOf('%');
+if (i != -1) {
+strippedHost = host.substring(0, i) + "]";
+}
+}
+if (!strippedHost.equals(host)) {

Review Comment:
   @arturobernalg How about this?
   ```
   String strippedHost = null;
   if (host.charAt(0) == '[') {
 final int i = host.lastIndexOf('%');
 if (i != -1) {
   strippedHost = host.substring(0, i) + "]";
 }
   }
   if (strippedHost != null) {
 return InetAddress.getAllByName(strippedHost);
   }
   throw e;
   ```



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] arturobernalg commented on a diff in pull request #418: Fix issue with LLv6 literals in URLs

2023-03-03 Thread via GitHub


arturobernalg commented on code in PR #418:
URL: 
https://github.com/apache/httpcomponents-client/pull/418#discussion_r1124939005


##
httpclient5/src/main/java/org/apache/hc/client5/http/SystemDefaultDnsResolver.java:
##
@@ -40,7 +40,23 @@ public class SystemDefaultDnsResolver implements DnsResolver 
{
 
 @Override
 public InetAddress[] resolve(final String host) throws 
UnknownHostException {
-return InetAddress.getAllByName(host);
+try {
+// Try resolving using the default resolver
+return InetAddress.getAllByName(host);
+} catch (final UnknownHostException e) {
+// If default resolver fails, try stripping the IPv6 zone ID and 
resolving again
+String strippedHost = host;
+if (host.charAt(0) == '[') {
+final int i = host.lastIndexOf('%');
+if (i != -1) {
+strippedHost = host.substring(0, i) + "]";
+}
+}
+if (!strippedHost.equals(host)) {

Review Comment:
   @ok2c , there is no significant difference between the two code snippets you 
provided. Both snippets attempt to strip the IPv6 zone ID from the host name if 
it is present and retry the resolution if the default resolver fails.
   But I any case, I made the change 



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c commented on a diff in pull request #418: Fix issue with LLv6 literals in URLs

2023-03-03 Thread via GitHub


ok2c commented on code in PR #418:
URL: 
https://github.com/apache/httpcomponents-client/pull/418#discussion_r1124960216


##
httpclient5/src/main/java/org/apache/hc/client5/http/SystemDefaultDnsResolver.java:
##
@@ -40,7 +40,23 @@ public class SystemDefaultDnsResolver implements DnsResolver 
{
 
 @Override
 public InetAddress[] resolve(final String host) throws 
UnknownHostException {
-return InetAddress.getAllByName(host);
+try {
+// Try resolving using the default resolver
+return InetAddress.getAllByName(host);
+} catch (final UnknownHostException e) {
+// If default resolver fails, try stripping the IPv6 zone ID and 
resolving again
+String strippedHost = host;
+if (host.charAt(0) == '[') {
+final int i = host.lastIndexOf('%');
+if (i != -1) {
+strippedHost = host.substring(0, i) + "]";
+}
+}
+if (!strippedHost.equals(host)) {

Review Comment:
   @arturobernalg There is a bg difference in terms of performance between 
`if (strippedHost != null)` and `if (!strippedHost.equals(host))`



-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] arturobernalg opened a new pull request, #419: Fix calculation of freshness lifetime in HttpResponse

2023-03-04 Thread via GitHub


arturobernalg opened a new pull request, #419:
URL: https://github.com/apache/httpcomponents-client/pull/419

   This pull request adds a fix for the calculateFreshnessLifetime method in 
the HttpResponseCache class. The method calculates the freshness lifetime of a 
response based on the headers in the response and follows the algorithm for 
calculating the freshness lifetime described in RFC 7234, section 4.2.1.
   
   The method takes into account the s-maxage, max-age, Expires, and Date 
headers as follows:
   
   If the s-maxage directive is present in the Cache-Control header of the 
response, its value is used as the freshness lifetime for shared caches, which 
typically serve multiple users or clients.
   If the max-age directive is present in the Cache-Control header of the 
response, its value is used as the freshness lifetime for private caches, which 
serve a single user or client.
   If the Expires header is present in the response, its value is used as the 
expiration time of the response. The freshness lifetime is calculated as the 
difference between the expiration time and the time specified in the Date 
header of the response.
   If none of the above headers are present or if the calculated freshness 
lifetime is invalid, a default value of 5 minutes is returned.
   The existing implementation had a bug where it did not handle the case where 
the max-age directive was present in the Cache-Control header but the s-maxage 
directive was not. In this case, the method would incorrectly return the 
default freshness lifetime of 5 minutes instead of using the max-age value as 
the freshness lifetime. This pull request fixes the bug by adding a check for 
the s-maxage directive and returning the max-age value if the s-maxage 
directive is not present.
   
   Motivation
   The bug in the calculateFreshnessLifetime method could cause incorrect 
caching behavior, which could lead to degraded performance and unexpected 
results for clients. By fixing this bug, we ensure that the method correctly 
calculates the freshness lifetime of responses and that clients can rely on the 
cache to serve responses efficiently and accurately.
   
   Changes Made
   To fix the bug, we added a check for the s-maxage directive in the 
Cache-Control header and updated the return value of the method to use the 
max-age value if the s-maxage directive is not present.


-- 
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: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



  1   2   3   4   5   6   7   8   9   10   >