Skip to content

Instantly share code, notes, and snippets.

@dangerouse
Created October 15, 2014 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dangerouse/39c38b8690141d2d8f61 to your computer and use it in GitHub Desktop.
Save dangerouse/39c38b8690141d2d8f61 to your computer and use it in GitHub Desktop.
CloudSponge Proxy Controller - Ruby
require 'cloudsponge'
class CloudspongeController < ApplicationController
def cloudsponge_proxy
url = Cloudsponge::URL_BASE + 'auth?' + request.query_string
response = Cloudsponge::Utility::get_url(url);
if response.is_a?(Net::HTTPRedirection)
redirect_to response["location"]
else
render :text => response.try(:body)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment