
Security News
Critical Security Vulnerability in React Server Components
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.
vidibus-validate_uri
Advanced tools

It provides validation of URIs (URLs) to ActiveModel records and ActionControllers in Rails 3 and 4.
This gem is part of Vidibus, an open source toolset for building distributed (video) applications.
Add gem "vidibus-validate_uri" to your Gemfile. Then call bundle install on your console.
To validate an URI in your ActiveModel record, simply add the uri validator to the field you want to validate as URI:
class Model
include Mongoid::Document
field :some_uri
validates :some_uri, :uri => true
end
To validate an URI in any model, include ActiveModel::Validations:
class Model
include ActiveModel::Validations
attr_accessor :uri
validates :some_uri, :uri => true
end
Just in case you'll need it, a method valid_uri? is available to controllers that inherit from ActionController::Base. Use it like this:
valid_uri?("something") # => false
To restrict validation to a certain protocol, provide a :protocol option:
validates :some_uri, :uri => {:protocol => :rtmp}
validates :some_uri, :uri => {:protocol => [:rtsp, :rtmp]}
To check if the uri is accessible over the network, provide an :accessible option:
validates :some_uri, :uri => {:accessible => true}
Just like for any other ActiveModel validation, you may allow blank values by providing an :allow_blank option:
validates :some_uri, :uri => {:allow_blank => true}
You may provide those validation options to the valid_uri? method as well:
valid_uri?(your_uri, :accessible => true)
valid_uri?(your_uri, :protocol => :rtmp)
valid_uri?(your_uri, :protocol => [:rtsp, :rtmp])
© 2010-2013 Andre Pankratz. See LICENSE for details.
FAQs
Unknown package
We found that vidibus-validate_uri 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
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.

Research
/Security News
We spotted a wave of auto-generated “elf-*” npm packages published every two minutes from new accounts, with simple malware variants and early takedowns underway.

Security News
TypeScript 6.0 will be the last JavaScript-based major release, as the project shifts to the TypeScript 7 native toolchain with major build speedups.