-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix code scanning alert #1530
Fix code scanning alert #1530
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1530 +/- ##
==========================================
+ Coverage 84.57% 84.63% +0.07%
==========================================
Files 156 156
Lines 4795 4795
==========================================
+ Hits 4055 4058 +3
+ Misses 740 737 -3
|
@@ -329,7 +329,7 @@ TEST_F(BasicCurlHttpTests, SendGetRequestSyncTimeout) | |||
curl::HttpClientSync http_client; | |||
|
|||
http_client::Headers m1 = {}; | |||
auto result = http_client.Get("http://222.222.222.200:19000/get/", m1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering why is the IP address changed? I think it is intended as some invalid/unreachable address. @lalitb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this address is invalid either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some local app could listen on https://127.0.0.1:19000?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also use the address from Documentation Address Block
(https://datatracker.ietf.org/doc/html/rfc5737#section-4), as they are not allowed to be used on the public internet, and so would be always unreachable.
192.0.2.0 – 192.0.2.255
198.51.100.0 – 198.51.100.255
233.252.0.0 - 233.252.0.255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Some implements of libcurl will connect failed immediately and call the callback in the IO thread if it try to connect a invalid address. And the callback will reset |
Thanks @owent, it fixed :) |
Fixes #1529 (issue)
Changes
uses HTTPS URLs
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes