Skip to content

Cookie Jar Documentain Fix#21038

Closed
svm1048 wants to merge 1 commit intorapid7:masterfrom
svm1048:master
Closed

Cookie Jar Documentain Fix#21038
svm1048 wants to merge 1 commit intorapid7:masterfrom
svm1048:master

Conversation

@svm1048
Copy link

@svm1048 svm1048 commented Mar 1, 2026

This PR fixes a broken code example in the HTTP library documentation for HttpCookieJar (specifically in how-to-send-an-http-request-using-httpclient.md).

Previously, copying and pasting the example into irb resulted in an ArgumentError: domain is missing because the http-cookie library requires a domain parameter to instantiate a new cookie object. I updated the snippet to include domain: 'example.com', path: '/' so developers have a fully functional, runnable example.

Fixes issue #18573

Verification
[x] Start msfconsole
[x] Drop into the interactive Ruby shell by typing irb
[x] Paste the updated code from the documentation:

cj = Msf::Exploit::Remote::HTTP::HttpCookieJar.new
cj.add(Msf::Exploit::Remote::HTTP::HttpCookie.new('PHPSESSID', 'dummy_value', domain: 'example.com', path: '/'))

[x] Verify the command succeeds and returns the HttpCookieJar object without throwing the ArgumentError: domain is missing exception.
[x] Verify the code block is formatted correctly in the markdown file.

@h00die
Copy link
Contributor

h00die commented Mar 1, 2026

I haven't looked at the differences, but #21025 looks to solve the same problem

@svm1048
Copy link
Author

svm1048 commented Mar 2, 2026

oh okay, yea i just took a look at #21025 and seems like both of us implemented the same idea for #18573

@msutovsky-r7 msutovsky-r7 added the needs-unique-branch The pull request must not be from the master branch label Mar 2, 2026
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Thanks for your pull request! We require for all contributed code to come from a from a unique branch in your repository before it can be merged.

Please create a new branch in your fork of framework and resubmit this from that branch.

If you are using Git on the command line that may look like:

# Checkout the master branch
git checkout master

# Create a new branch for your feature
git checkout -b <BRANCH_NAME>

# Add your new files
git add modules/my-cool-new-module

# Commit your changes with a relevant message
git commit

# Push your changes to GitHub
git push origin <BRANCH_NAME>

# Now browse to the following URL and create your pull request!
# - https://github.com/rapid7/metasploit-framework/pulls

This helps protect the process, ensure users are aware of commits on the branch being considered for merge, allows for a location for more commits to be offered without mingling with other contributor changes and allows contributors to make progress while a PR is still being reviewed.

Please do resubmit from a unique branch, we greatly value your contribution! 🎉

@github-actions github-actions bot closed this Mar 2, 2026
@github-project-automation github-project-automation bot moved this from Todo to Done in Metasploit Kanban Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-unique-branch The pull request must not be from the master branch

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants