-
Notifications
You must be signed in to change notification settings - Fork 8
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
Encode the file path in url authority so we don't crash on whitespaces #499
Encode the file path in url authority so we don't crash on whitespaces #499
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #499 +/- ##
=======================================
Coverage ? 70.39%
=======================================
Files ? 204
Lines ? 27843
Branches ? 0
=======================================
Hits ? 19600
Misses ? 8243
Partials ? 0
|
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.
So why don't we URL encode the path with %20
for space etc?
Would %20 work for a file path on Windows? Since I found this issue by calling ddog_endpoint_from_url(), would it be possible to add a test to validate that it does not return a null pointer? |
I reused the existing method to encode paths in urls. In the end it doesn't really matter because it's just an internal representation. |
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.
Thanks for the explanation.
115b5b2
to
ddcb56d
Compare
What does this PR do?
Encode the file path in url authority so we don't crash on whitespaces
Motivation
The telemetry lib would fail because of a panic on URI violation, because we were trying to encode the file path in the url path, which doesn't accept some characters.
This PR encodes the path as hex, like we do for unix socket and windows pipe.
Additional Notes
Anything else we should know when reviewing?
How to test the change?
Describe here in detail how the change can be validated.