Skip to content

Instantly share code, notes, and snippets.

@julien51
Created October 20, 2009 02:33
Show Gist options
  • Save julien51/213940 to your computer and use it in GitHub Desktop.
Save julien51/213940 to your computer and use it in GitHub Desktop.
# Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
class ExtractHubVerifyParams
def self.call(env)
request = Rack::Request.new(env)
params = request.params
if hub_verify = env["rack.input"].read.match(/hub.verify=(.*)&hub.verify=(.*)/)
params['hub.verify'] = ""
params['hub.verify'] = "#{hub_verify[1]},#{hub_verify[2]}"
end
[404, {"Content-Type" => "text/html"}, ["Not Found"]]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment