Skip to content

Conversation

jessarcher
Copy link
Member

@jessarcher jessarcher commented Sep 29, 2025

This PR introduces the capturing of request body on inbound requests when an unhandled exception occurs.

This feature is not enabled by default. It can be enabled with the following environment variable:

NIGHTWATCH_CAPTURE_REQUEST_PAYLOAD=true

The following payload fields will be redacted by default: _token, password, password_confirmation. They can be customized with the following environment variable:

NIGHTWATCH_REDACT_PAYLOAD_FIELDS=_token,password,password_confirmation,secret_key

When a field is redacted, the field name is always preserved so you know what fields were present. The value will be replaced by an indication of how many bytes were redacted. E.g. [123 bytes redacted].

@jessarcher jessarcher force-pushed the capture-request-body branch 2 times, most recently from 4388950 to 544aa27 Compare September 29, 2025 05:55
@jessarcher jessarcher force-pushed the capture-request-body branch 3 times, most recently from 35a2ff3 to 300a22e Compare October 8, 2025 05:04
@jessarcher jessarcher force-pushed the capture-request-body branch from 300a22e to ddd00b6 Compare October 8, 2025 05:21
@jessarcher jessarcher changed the title Capture request body on unhandled exception Capture request payload on unhandled exception Oct 15, 2025
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.

1 participant