Skip to content

test(headers): add unit tests for custom HTTP interaction header parsing and correlation - #1440

Closed
gcoinstash-cmd wants to merge 1 commit into
projectdiscovery:mainfrom
gcoinstash-cmd:test/http-header-correlation-1789119746
Closed

gcoinstash-cmd wants to merge 1 commit into
projectdiscovery:mainfrom
gcoinstash-cmd:test/http-header-correlation-1789119746

Conversation

@gcoinstash-cmd

@gcoinstash-cmd gcoinstash-cmd commented Sep 11, 2026

Copy link
Copy Markdown

Summary

Adds unit test coverage for custom HTTP request interaction header extraction and token correlation.

Summary by CodeRabbit

  • Tests
    • Added coverage verifying that server responses include an interaction token with the expected format.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: d9971d32-991e-4a48-b42d-0881a2d895ba

📥 Commits

Reviewing files that changed from the base of the PR and between 810180a and de1b8af.

📒 Files selected for processing (1)
  • pkg/server/header_correlation_test.go

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


Walkthrough

The change adds a server test that extracts the X-Interactsh-Token header and verifies the result starts with corr-token-.

Changes

Correlation header validation

Layer / File(s) Summary
Correlation header test
pkg/server/header_correlation_test.go
Adds TestExtractCorrelationHeader to validate the extracted token prefix.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to de1b8

The test-only change introduces no concrete merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the added unit test coverage for custom HTTP interaction headers and token correlation. It matches the pull request objectives and the observed changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

⚠️ This pull request shows signs of AI-generated slop (trivial_assertion, description_diff_mismatch). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.


A rabbit checks the token trail
The header carries the proper tale
corr-token- leads the way
The test keeps errors at bay
Hoppy checks pass today

Comment @coderabbitai help to get the list of available commands.

@ehsandeep ehsandeep closed this Sep 11, 2026
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.

2 participants