-
-
Notifications
You must be signed in to change notification settings - Fork 365
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
Refactor ChuckerInterceptor processing internals #527
Conversation
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
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? |
Joining here (needed some break). Agree with Nico here about splitting the PR for more manageable size. |
I don't think it will shave off much from this PR because most of it is moving internals of |
Closing this one. I started splitting it into smaller PRs. |
📄 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
IOUtils
class in favour of extensions onOkio
andOkHttp
. I also added two classes –RequestProcessor
andResponseProcessor
to remove direct complexity inChuckerInterceptor
. These classes do too much ATM anyway but it is some start.I fixed also some bugs.
ChuckerInterceptor
as it can't do it anyway.Some other changes.
HttpTransaction
hasisRequestBodyPlainText
andisResponseBodyPlainText
now set tofalse
by 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_eof
message 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.