fix: Various fixes to make http-recorder usable again. #2983
Merged
xerial merged 11 commits intowvlet:masterfrom May 25, 2023
Merged
fix: Various fixes to make http-recorder usable again. #2983xerial merged 11 commits intowvlet:masterfrom
xerial merged 11 commits intowvlet:masterfrom
Conversation
This reverts commit 05420e4.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2983 +/- ##
==========================================
- Coverage 82.85% 82.81% -0.04%
==========================================
Files 348 348
Lines 14591 14604 +13
Branches 2382 2381 -1
==========================================
+ Hits 12089 12095 +6
- Misses 2502 2509 +7
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
NicolasRichard
commented
May 25, 2023
| @@ -22,8 +22,31 @@ import wvlet.log.LogSupport | |||
| * @param endpoint | |||
| */ | |||
| class RedirectToRxEndpoint(endpoint: RxHttpEndpoint) extends LogSupport { | |||
Collaborator
Author
There was a problem hiding this comment.
@xerial Any potential side-effects? Any probability something would be relying on the method name or the fact that it only has a GET endpoint?
Member
There was a problem hiding this comment.
This one is added only for providing an adapter for http-recorder, so this fix is ok. Thanks
xerial
reviewed
May 25, 2023
| def nonEmpty: Boolean = !isEmpty | ||
| def toContentString: String | ||
| def toContentBytes: Array[Byte] | ||
| def contentHash: Int = toContentBytes.hashCode() |
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.
As it stands, http-recorder only works with GET requests without a body. This situation is caused by two issues:
Arrays.hashcodeshould be used to compute an hash code over the content of the array as thehashcodemethod on the array itself only relies on the address of the object.RedirectToRxEndpointonly exposes aGETendpoint. No other verbs can pass-through. I don't know if there's a better way to fix it, but the quick fix I'm proposing works.