Created
October 15, 2014 19:32
-
-
Save dangerouse/39c38b8690141d2d8f61 to your computer and use it in GitHub Desktop.
CloudSponge Proxy Controller - Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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