← Back to Blog

Sharing a HAR file without sharing your card number

When a web page misbehaves, support teams often ask for a HAR file: a recording of every request the page made. It's the fastest way to show them what actually happened. It also records far more than most people expect.

Recording one

  1. Open the page and the browser's developer tools (F12), then the Network tab.
  2. Tick Persist Logs (Firefox) or Preserve log (Chrome).
  3. Reload and reproduce the problem.
  4. Right-click a request and choose Save all as HAR.

Before you send it

A HAR holds everything the page sent and received: form fields you typed (including card numbers and addresses), cookies and session tokens. The browser's built-in redaction doesn't always catch everything. In one HAR we checked, the full card number was still sitting in the body of a card-lookup request.

So we wrote two small scripts, free and open source in JulioLabs/scripts. They need only Python, nothing to install:

# See what loaded and what failed, without printing any private data
python3 har/har_summary.py capture.har --failed

# Write a copy that's safe to share
python3 har/sanitize_har.py capture.har capture-safe.har

The safe copy keeps the timeline: which addresses were called, status codes, sizes and timings. That's usually all a support engineer needs. It drops bodies, cookies, auth headers and query values. It then checks its own output for anything left over from the original, card-like numbers and email addresses, and refuses to write the file if it finds any.

Send the safe copy, and delete the original once the issue is resolved.