[EXPORTER] handling of invalid ports in UrlParser#3142
Merged
marcalff merged 1 commit intoopen-telemetry:mainfrom Nov 14, 2024
Merged
[EXPORTER] handling of invalid ports in UrlParser#3142marcalff merged 1 commit intoopen-telemetry:mainfrom
marcalff merged 1 commit intoopen-telemetry:mainfrom
Conversation
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
sjinks
commented
Nov 14, 2024
Comment on lines
+93
to
+94
| url_.begin() + static_cast<std::string::difference_type>(cpos), | ||
| url_.begin() + static_cast<std::string::difference_type>(url_.length())); |
Contributor
Author
There was a problem hiding this comment.
static_cast<> is because "Narrowing conversion from 'size_t' (aka 'unsigned long') to signed type 'difference_type' (aka 'long') is implementation-defined"
See also: https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/narrowing-conversions.html
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3142 +/- ##
==========================================
+ Coverage 87.12% 87.83% +0.72%
==========================================
Files 200 195 -5
Lines 6109 6146 +37
==========================================
+ Hits 5322 5398 +76
+ Misses 787 748 -39
|
lalitb
approved these changes
Nov 14, 2024
malkia
added a commit
to malkia/opentelemetry-cpp
that referenced
this pull request
Nov 14, 2024
[EXPORTER] handling of invalid ports in UrlParser (open-telemetry#3142)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3138
Changes
This PR adds handling of invalid ports to UrlParser.
Previously, invalid ports caused an exception; this PR updated the code so as not to throw exceptions and set
success_tofalse.For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes