
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Sometimes, in the coures of human events, you need to access the currently executing http request, and you don't always have the luxury of passing it around, especially when you're working with frameworks that manage the lifecycle of objects for you, or you want to include functionality from a module. That module might not have a clean way of getting a reference to the request object.
CurrentRequest stores the current request in a thread local so that you can access it from anywhere inside the request stack.
Not really. There are certain objects whose natural scope is the lifetime of an http request. The http request object itself is one such object. As long as the thread is the fundamental unit of concurrency in your server, you'll be ok.
That said, you should ensure that you are in fact including this into methods that will be invoked inside the request stack, and not, say, like a background job (like sending email) that is fired off during the course of a request.
class Foo
include Rack::Curent
def current_url
"#{current_request.protocol}://#{current_request.host}/#{current_request.path}
end
end
FAQs
Unknown package
We found that rack-current 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.