
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Using this gem is probably a very bad idea in at least 98% of the cases I can think of. Think of a it as a HTTP client that doesn't care about the response and doesn't care about basically anything besides sending its payload to a server. An alternative name for this client is "scumbag-HTTP-client".
So, unless you are really sure you want to use this lib, you're probably better off looking at the hundreds other Ruby HTTP libraries.
Add this line to your application's Gemfile:
gem 'fire-and-forget', :require => 'fire/forget'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fire-and-forget
FAF.post "http://example.com", {:foo => 'bar'}, {"X-Custom" => true}
In the example above, the request will be sent as a JSON request and the
body (a Ruby hash) will be converted to json if to_json
is available on
the object (otherwise to_s
will be used).
FAF.post "http://example.com", "{\"language\": {\"created_at\": \"2010/11/23 19:47:05 +0000\",\"updated_at\": \"2010/11/23 19:47:05 +0000\",\"active\": true, \"code\": \"en\", \"id\":37}}"
Would send the request passing the JSON string as the body, strings aren't converted when passed as the request body.
Sometimes, you might want to debug the response or potentially slow down the application code. You can pass a block to do that:
FAF.post "http://example.com", {:foo => 'bar'} do |socket|
sleep(0.02)
end
or
FAF.post "http://example.com", {:foo => 'bar'} do |socket|
while output = socket.gets
print output
end
end
This will not "forget" about the response, but instead wait for data to come down the socket so we can print.
Currently, FAF only supports basic options, no authentication unless you pass all the details via the headers.
Once the request is sent, the socket is closed which might or might not please the server receiving the request (you might want to use a block/sleep to slow down the closing of the socket if your proxy/cache doesn't like that FAF closes the connection right away.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that fire-and-forget demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.