Skip to content

Add default Content-Type: application/json header for custom detector verification request#4947

Merged
MuneebUllahKhan222 merged 3 commits into
trufflesecurity:mainfrom
MuneebUllahKhan222:INS-475
May 5, 2026
Merged

Add default Content-Type: application/json header for custom detector verification request#4947
MuneebUllahKhan222 merged 3 commits into
trufflesecurity:mainfrom
MuneebUllahKhan222:INS-475

Conversation

@MuneebUllahKhan222

@MuneebUllahKhan222 MuneebUllahKhan222 commented May 4, 2026

Copy link
Copy Markdown
Contributor

Description

Custom detector verification requests do not currently include a default Content-Type: application/json header, which can lead to compatibility issues and may require using force=true as a workaround.

This PR updates the custom detector verification flow to always include Content-Type: application/json when making HTTP requests. Since verification requests consistently send JSON payloads, standardizing this behavior is safe and ensures more reliable integrations.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

Note

Low Risk
Low risk change limited to outbound custom detector verification requests; it only adds a default header when one is not already provided, which could affect integrations that relied on an omitted Content-Type.

Overview
Custom detector webhook verification requests now default Content-Type to application/json when the user-specified verifier headers don’t set one.

This standardizes verification POSTs (which send JSON bodies) and reduces the need for workarounds with endpoints that require an explicit content type.

Reviewed by Cursor Bugbot for commit ab5fc9a. Bugbot is set up for automated code reviews on this repo. Configure here.

@MuneebUllahKhan222 MuneebUllahKhan222 requested review from a team May 4, 2026 17:09

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 50903f3. Configure here.

Comment thread pkg/custom_detectors/custom_detectors.go Outdated

@trufflesteeeve trufflesteeeve left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread pkg/custom_detectors/custom_detectors.go Outdated
@MuneebUllahKhan222 MuneebUllahKhan222 merged commit 90ca685 into trufflesecurity:main May 5, 2026
16 checks passed
@MuneebUllahKhan222 MuneebUllahKhan222 deleted the INS-475 branch May 5, 2026 05:49
MuneebUllahKhan222 added a commit that referenced this pull request May 29, 2026
… verification request (#4947)

* added content-type=application/json as default header

* improv: set content type header when it is not present in the config

* handled canonicalization
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.

3 participants