Skip to content

fix: remove HTML from acceptable content types for trace recording#86

Merged
sohankshirsagar merged 1 commit intomainfrom
sohan/remove-html-content-type
Mar 25, 2026
Merged

fix: remove HTML from acceptable content types for trace recording#86
sohankshirsagar merged 1 commit intomainfrom
sohan/remove-html-content-type

Conversation

@sohankshirsagar
Copy link
Contributor

Summary

Removes DecodedType.HTML from ACCEPTABLE_CONTENT_TYPES. HTML responses are typically static pages or server-rendered views that are large, noisy, and poor candidates for regression testing

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@tusk-dev
Copy link

tusk-dev bot commented Mar 25, 2026

Generated 45 tests - 45 passed

Commit tests View tests

Tip

New to Tusk Unit Tests? Learn more here.

Test Summary

  • ACCEPTABLE_DECODED_TYPES - 2 ✓
  • get_decoded_type - 18 ✓
  • get_decoded_type and should_block_content_type - 8 ✓
  • should_block_content_type - 17 ✓

Results

Tusk's tests are all passing and directly validate the PR's core change: removing HTML from acceptable content types. The test suite confirms that DecodedType.HTML is now blocked by should_block_content_type, while DecodedType.JSON and DecodedType.PLAIN_TEXT remain unblocked. Critical end-to-end integration tests verify the flow from get_decoded_type through should_block_content_type works correctly for HTML (now blocked), JSON/plain text (still allowed), and other content types. The suite also validates edge cases like charset parameters, case-insensitivity, and unknown content types. This change reduces noise in trace recording by filtering out large, static HTML responses while preserving structured data formats.

Avg +100% line coverage gain across 1 file
Source file Line Branch
drift/core/content_type_utils.py 100% (+100%) 0%

Coverage is calculated by running tests directly associated with each source file, learn more here.

View check history

Commit Status Output Created (UTC)
75770dc Generated 45 tests - 45 passed Tests Mar 25, 2026 11:41PM

Was Tusk helpful? Give feedback by reacting with 👍 or 👎

@sohankshirsagar sohankshirsagar merged commit f605362 into main Mar 25, 2026
27 checks passed
@sohankshirsagar sohankshirsagar deleted the sohan/remove-html-content-type branch March 25, 2026 23:48
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