Sha256: aefc5a69a0c1c5086faad6be805e1594ce8719054097edf267b705632dee684c
Contents?: true
Size: 443 Bytes
Versions: 94
Compression:
Stored size: 443 Bytes
Contents
module NexmoDeveloper class BuildingBlockRedirect def initialize(app) @app = app end def redirect(location) [301, { 'Location' => location, 'Content-Type' => 'text/html' }, ['Moved Permanently']] end def call(env) req = Rack::Request.new(env) return redirect(req.path.gsub('/building-blocks/', '/code-snippets/')) if req.path.include? '/building-blocks/' @app.call(env) end end end
Version data entries
94 entries across 94 versions & 1 rubygems