-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix(offlinehttp): Replace "-" in headers with "_" for DSL variables #6363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(offlinehttp): Replace "-" in headers with "_" for DSL variables #6363
Conversation
WalkthroughThe code now further normalizes HTTP response header keys by replacing hyphens with underscores, in addition to previously trimming whitespace and converting to lowercase. This affects the format of header keys in the resulting DSL map, changing keys like "content-type" to "content_type". Correspondingly, the related test was updated to reflect this new key format. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (2)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@coderabbitai can you take a look at |
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chainI'll examine all the 🏁 Script executed:
Length of output: 7027 @dwisiswant0 I've examined all the Good news - no other files are affected! Here's the breakdown: Files with HTTP header processing:
Files that don't need the fix:
Conclusion:The current PR successfully brings The consistency issue has been properly resolved! 🎯 |
Signed-off-by: Dwi Siswanto <[email protected]>
…6363) * Replace "-" in headers with "_" for DSL variables in passive mode * test(offlinehttp): adjust haystack & needle in `TestHTTPOperatorExtract` Signed-off-by: Dwi Siswanto <[email protected]> --------- Signed-off-by: Dwi Siswanto <[email protected]> Co-authored-by: Dwi Siswanto <[email protected]>
Proposed changes
This fix the bug mentioned in #6362
The change makes the passive mode handles header the same as active mode here:
nuclei/pkg/protocols/http/operators.go
Line 117 in 91adfeb
I didn't add test or documentation since this should be a small bug fix.
Checklist
Summary by CodeRabbit