Closed eschlenz closed 7 years ago
Thanks! I've finally got my mock web server setup to send responses large enough to break things, so I will look at this as soon as possible.
I looks like it is Android's CursorWindow that breaks first, whose hard limit is 2048 KB.
@joaocsousa @jgilfelt Thanks for the review. I've made the switch from Integer to Long per joaocsuousa's recommendation. I've responded to the other callout (whether or not to keep the partial result).
Fixed the merge conflicts as well.
@jgilfelt Saw your change requests. I'll knock that out tomorrow and hit you back.
@jgilfelt @joaocsousa
I have addressed the feedback you guys gave me:
With maxContentLength left at its default value:
With maxContentLength set to 5 (for testing):
@eschlenz Nice work! I've just updated the method comment to reflect the new truncation behaviour. Thanks for putting this together so quickly.
@jgilfelt No problem! Happy to help.
…resents a threshold for content that should be saved verbatim, or not.
@jgilfelt
WHAT: This PR introduces a "max content length" property to the
ChuckInterceptor
. A request or response body that exceeds the new property's value will not be recorded. That is, there will still be a record of the transaction, but the content itself is not kept.WHY: Chuck was crashing on me when I would try to go to the Chuck UI. I determined that the saved response body for a few of my requests were simply too large for SQLite to handle. In such scenarios, I still want to see the transaction in the log. I don't need to see the content however. It made sense to apply this new max content length property to requests as well.
The max content length property is essentially disabled by default (set to Integer.MAX_VALUE). The user can optionally set a max length that works for them.
MISC: I tried to stick with the existing code conventions. Thanks for putting this tool together. It's very handy.