Skip to content
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

Request processing refactor #542

Merged
merged 3 commits into from
Jan 29, 2021
Merged

Request processing refactor #542

merged 3 commits into from
Jan 29, 2021

Conversation

MiSikora
Copy link
Contributor

📄 Context

ChuckerInterceptor was doing too much and it would be hard to integrate #523 in a sane manner.

📝 Changes

I refactored code responsible for requests processing.

  • Added LimitingSource that replaces method on IOUtils that read limited amount of content. Due to that chucker_body_unexpected_eof message is removed as it is now impossible to read too much from in-memory buffers while processing the response.
  • Added RequestProcessor that moves away request logic from the interceptor.
  • HttpTransaction has isRequestBodyPlainText is now set to false by default and changed to true only when plain text is detected.
  • Added interceptor tests for request processing.
  • Added logging for handling exceptions while processing requests.

📎 Related PR

#527

🚫 Breaking

No.

🛠️ How to test

Added some tests. Other than that, sample app should behave the same.

⏱️ Next steps

Similar PR for response to follow. Also PRs fixing some other issues mentioned in #527.

- Limit content length with limiting source.
- Do not assume that request has plain text body.
@vbuberen vbuberen merged commit 270dc80 into develop Jan 29, 2021
@vbuberen vbuberen deleted the request-processing-refactor branch January 29, 2021 22:52
@vbuberen
Copy link
Collaborator

Sorry, I occasionally merged this PR instead of my PR with workflow update 🙈🤦🤦🤦🤦

@vbuberen vbuberen restored the request-processing-refactor branch January 29, 2021 22:55
@vbuberen
Copy link
Collaborator

vbuberen commented Jan 29, 2021

Restored the branch. Reverting pull request it probably too much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants