-
Notifications
You must be signed in to change notification settings - Fork 1.8k
utils: handle ipv6 hosts when splitting URLs #10706
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,8 @@ struct url_check url_checks[] = { | |
{0, "https://fluentbit.io:1234/", "https", "fluentbit.io", "1234", "/"}, | ||
{0, "https://fluentbit.io:1234/v", "https", "fluentbit.io", "1234", "/v"}, | ||
{-1, "://", NULL, NULL, NULL, NULL}, | ||
{0, "http://[fd00:ec2::23]/v1/credentials", "http", "fd00:ec2::23", "80", "/v1/credentials"}, | ||
{0, "https://[::192.9.5.5]:1234/v", "https", "::192.9.5.5", "1234", "/v"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Self-review: I am not sure here if there will be a problem when actually trying to use the hosts because we stripped out the enclosing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They were trying to strip out the brackets but I suspect without -2 we would end up with URIs ending with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, I saw that failure mode before I switched it from |
||
}; | ||
|
||
void test_url_split_sds() | ||
|
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.
for the casual reader, the change from -1 to -2 to remove the bracket from the new substring