-
Notifications
You must be signed in to change notification settings - Fork 11
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
Additional EmbraceUrlConnectionDelegate unit tests and bug fixes #50
Conversation
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
b16e8ba
to
115affb
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #50 +/- ##
==========================================
+ Coverage 73.47% 74.60% +1.13%
==========================================
Files 306 306
Lines 10070 10082 +12
Branches 1448 1454 +6
==========================================
+ Hits 7399 7522 +123
+ Misses 2103 1980 -123
- Partials 568 580 +12
|
115affb
to
3d53364
Compare
8de4c9f
to
c78bdc8
Compare
@@ -28,7 +28,7 @@ public String getHeaderByName(@NonNull String name) { | |||
public String getOverriddenURL(@NonNull String pathOverride) { | |||
try { | |||
return new URL(connection.getURL().getProtocol(), connection.getURL().getHost(), | |||
connection.getURL().getPort(), pathOverride).toString(); | |||
connection.getURL().getPort(), pathOverride + "?" + connection.getURL().getQuery()).toString(); |
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.
What's the purpose of this change? Is it because we were discarding the query params?
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.
Yeah. This is the bug I mention in the second bullet point in the PR description. When you toString()
a URL
, it includes the query path as part of the returned string. When we return teh URL with an overridden path, we should do the same. (This is what the OkHttp implementation does)
Goal
Add additional unit tests for more cases for logging URLConnection requests and fix a few issues that were found. Specifically:
Testing
Add unit tests of important cases where breakage may not be obvious