How can you inspect an HTTP exchange without exposing credentials?
Quick answer
Before sharing an HTTP exchange, make a separate copy and replace credential values and private information with clear placeholders. In particular, omit or replace values in Authorization and Proxy-Authorization headers: they carry credentials. [S1] Keep only the request and response details needed to explain the issue, and check the entire example—including URLs, headers, and body—for sensitive values before sharing. A generic example can show a 401 challenge without a real credential. [S2]
The question, the details, the next step.
A practical checklist
Work from a separate copy; do not paste the unedited exchange into the report.
Replace or omit real values in
AuthorizationandProxy-Authorizationheaders. [S1]Review URLs, query parameters, cookies, other headers, and message bodies for private values.
Keep only the method, generalized path, status, and response details needed to explain the issue.
Read the final example from beginning to end and replace identifying values with clear placeholders.
A few more useful answers
Should I include a real authorization token if it helps explain the failure?
No. Replace the value with [redacted] or omit the header. The header carries authentication credentials, so a generic placeholder is more appropriate for a shared example. [S1]
Can I explain a 401 response without sharing a credential?
Yes. Use a generic protected-resource request and, if relevant, describe the WWW-Authenticate challenge in the response. MDN’s example illustrates this without requiring a real credential. [S2]
Does this template guarantee that every sensitive value has been removed?
No. It is a review aid, not a guarantee or a prescribed sanitization method. Inspect the full exchange and follow the sharing rules that apply to your situation.
Sources
References used for this guide.
- [S1] HTTP authentication — HTTP | MDN developer.mozilla.org · Checked
- [S2] 401 Unauthorized — HTTP | MDN developer.mozilla.org · Checked
