Skip to content

[Tool #115] HAR Sanitizer keeps stale sanitized output after parsing invalid HAR #374

Description

@baixiangcpp

Summary

HAR Viewer / Sanitizer partially resets after a parse failure: Requests becomes 0, but the previous Sanitized HAR and Redactions count remain visible, with no parse-error feedback.

Affected tool: HAR Viewer / Sanitizer
Route: https://byteflow.tools/en/har-viewer-sanitizer
Observed during browser acceptance: 2026-08-18

Reproduction

  1. Open the affected route.
  2. Load the built-in Try Example.
  3. Parse the example and confirm that Sanitized HAR and redaction statistics are populated.
  4. Change the HAR input to:
{bad
  1. Click Parse.
  2. Inspect Requests, Sanitized HAR, Redactions, and error feedback.

Actual output

After parsing the invalid input:

  • Requests changes to 0;
  • the previous Sanitized HAR remains visible;
  • the previous Redactions count remains visible (7 in the observed run);
  • no Invalid HAR or parse-error message is shown.

The page combines the new failed parse state with output generated from the previous valid document.

Expected output

When Parse fails, the tool should clear or invalidate all derived output and show a user-visible error, for example:

Invalid HAR: could not parse input

Requests and Redactions should represent the failed or empty state, and the old Sanitized HAR must not remain copyable as if it came from the current input.

Impact

Users may copy sanitized data from a previous HAR while believing it was generated from the current input. Missing error feedback also makes malformed input difficult to diagnose.

Regression coverage

Parse a valid HAR, then invalid JSON/text, then another valid HAR. Assert that results, counts, Copy state, and error feedback always correspond to the latest parse attempt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions