
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
This gem provides support to prevent a request from hitting the controller when the CORS validation fails.
This gem will only work for gem Rack::Cors at version '0.3.0'. At this time, November 18th 2014, the '0.3.0' version is in the 'master' branch, so you need to include the gem like this
gem 'rack-cors', :require => 'rack/cors', github: "cyu/rack-cors", branch: 'master'
In your Gemfile
add the line
gem 'rack-cors-halt'
and then run
bundle
or install it yourself with
gem install rack-cors-halt
In the config.ru
file you need to configure the Rack::Cors::Halt
middleware by passing it in the use
command:
use Rack::Cors::Halt
In your config/application.rb
you'll need something like this:
module YourApp
class Application < Rails::Application
# ...
config.middleware.insert_before 1, "Rack::Cors::Halt"
end
end
why .insert_before 1
? Typically the first middleware will be the Rack::Cors
one, so the best approach is to place the Rack::Cors::Halt
beneath that one so no more middlewares are runned.
FAQs
Unknown package
We found that rack-cors-halt 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
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.