Skip to content

Request processing refactor#542

Merged
vbuberen merged 3 commits into
developfrom
request-processing-refactor
Jan 29, 2021
Merged

Request processing refactor#542
vbuberen merged 3 commits into
developfrom
request-processing-refactor

Conversation

@MiSikora

Copy link
Copy Markdown
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.

Michał Sikora added 2 commits January 29, 2021 21:40
- 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
Copy Markdown
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

vbuberen commented Jan 29, 2021

Copy link
Copy Markdown
Collaborator

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