Tank icon indicating copy to clipboard operation
Tank copied to clipboard

Filter by content-type to save responseBody

Open Zakaria-Kofiro opened this issue 1 year ago • 1 comments

Filter by content-type to save responseBody Skips step to save response data based on content-type to avoid holding on to large responses:

if (checkContentType(contentType)) {
    responseBody = is.readAllBytes();
} else {
     is.readAllBytes();
}

Filters out any response data with Content-Type:

  • application/pdf
  • audio/*
  • video/*
  • image/*

Please make sure these check boxes are checked before submitting

  • [ ] ** Squashed Commits **
  • [ ] ** All Tests Passed ** - mvn clean test -P default

** PR review process **

  • Requires one +1 from a reviewer
  • Repository owners will merge your PR once it is approved.

Zakaria-Kofiro avatar Apr 23 '24 22:04 Zakaria-Kofiro

@Zakaria-Kofiro Rather than hardcoding the excluded mime types. Can we read the list in from the settings files that already contains

    <!-- Mime type rgex for logging of response body on error. -->
    <valid-mime-types>
      <mime-type-regex>.*text.*</mime-type-regex>
      <mime-type-regex>.*json.*</mime-type-regex>
      <mime-type-regex>.*xml.*</mime-type-regex>
    </valid-mime-types>

kevin-mcgoldrick avatar Apr 25 '24 18:04 kevin-mcgoldrick