Refactor ChuckerInterceptor processing internals#527
Closed
MiSikora wants to merge 13 commits into
Closed
Conversation
added 13 commits
January 5, 2021 20:08
It might be the case that an exception is thrown while getting the response and request headers would never be redacted.
4cc31f2 to
fcb4ffa
Compare
Member
I have to admit that this has been sitting in my Inbox for a month 😅 (I was also pretty busy). Sorry for that. Could we split this PR out in smaller ones given that is a ~1K LOC diff? Ideally have a refactoring one and others for every PR? |
Collaborator
|
Joining here (needed some break). Agree with Nico here about splitting the PR for more manageable size. |
Contributor
Author
|
I don't think it will shave off much from this PR because most of it is moving internals of |
This was referenced Jan 27, 2021
Merged
Contributor
Author
|
Closing this one. I started splitting it into smaller PRs. |
This was referenced Jan 29, 2021
This was referenced Jan 30, 2021
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.
📄 Context
I started working on #523 but it was rather hard to give some public API for custom requests and responses processing.
📝 Changes
There is a lot of code changes but most of it is just refactor. I deleted
IOUtilsclass in favour of extensions onOkioandOkHttp. I also added two classes –RequestProcessorandResponseProcessorto remove direct complexity inChuckerInterceptor. These classes do too much ATM anyway but it is some start.I fixed also some bugs.
ChuckerInterceptoras it can't do it anyway.Some other changes.
HttpTransactionhasisRequestBodyPlainTextandisResponseBodyPlainTextnow set tofalseby default. I feel it is better to rely on explicitly detecting plain text rather than assuming it. The implication is different message in export files for bodies without content.chucker_body_unexpected_eofmessage is removed as it is now impossible to read too much from in-memory buffers while processing the response.🚫 Breaking
No.
🛠️ How to test
I added some unit tests for request processing in
ChuckerInterceptor. You can run the sample and check if everything is fine.⏱️ Next steps
I'll need to resolve some conflicts after merging #526. Or remove logging changes from this PR if #526 does not get accepted.