Last active
October 14, 2015 05:37
-
-
Save dangerouse/1623391 to your computer and use it in GitHub Desktop.
Cloudsponge Proxy Reference - 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' | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's my revision for Rails, FWIW.