
Security News
Researcher Exposes Zero-Day Clickjacking Vulnerabilities in Major Password Managers
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
search_engine_referer
Advanced tools
#SearchEngineReferer Get meta information from search engine`s referer for
##Instalation
Add the folowing line to Gemfile and then run bundle
command.
gem 'search_engine_referer'
##Usage In your code use:
referer = SearchEngineReferer.parse('http://google.com?q=ruby&start=20')
referef.search_engine # => :google
referer.page # => 3
referer.query # => 'ruby'
non_search_enfine_referer = SearchEngineReferer.parse('http://example.com?q=ruby')
non_search_enfine_referef # => nil
##Middleware
Tiny middleware provided. It adds search_engine_referer
key to env with found referer. Examples:
Uses HTTP_REFERER
from env
use SearchEngineReferer::Middleware
Uses CUSTOM_ENV_KEY
for referer lookup
use SearchEngineReferer::Middleware, 'CUSTOM_ENV_KEY'
Uses provided proc for referer lookup
use SearchEngineReferer::Middleware do |env|
env['action_pack.cookies']['referer']
end
##Controller Helpers
Its add helpers for controllers and views: search_engine_referer
and search_engine_query
.
search_engine_referer_source
method for referer source manipulations.
By default it returns request.referer
. It can be overwritten in controller, for example:
def search_engine_referer_source
cookies[:search_engine_referer] || super
end
Note that helpers will use env['search_engine_referer']
if it provided by middleware
##Development Fully tested pull requests are welcome.
FAQs
Unknown package
We found that search_engine_referer 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
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.