Created
July 21, 2009 16:42
-
-
Save iwadon/151451 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| diff --git a/amazon-auth-proxy.cgi b/amazon-auth-proxy.cgi | |
| index 8c12e06..3f8ddd3 100755 | |
| --- a/amazon-auth-proxy.cgi | |
| +++ b/amazon-auth-proxy.cgi | |
| @@ -63,11 +63,7 @@ def paapi( conf, params ) | |
| end | |
| qs << "Signature=#{u [hash].pack( "m" ).chomp}" | |
| - url = uri.to_s + '?' + qs * '&' | |
| - | |
| - timeout( 10 ) do | |
| - open( url, &:read ) | |
| - end | |
| + uri.to_s + '?' + qs * '&' | |
| end | |
| if __FILE__ == $0 then | |
| @@ -78,13 +74,8 @@ if __FILE__ == $0 then | |
| conf = YAML::load_file( 'amazon-auth-proxy.yaml' ) | |
| begin | |
| - header = cgi.header( | |
| - 'status' => '200', | |
| - 'type' => 'text/xml;charset="UTF-8"' | |
| - ) | |
| - body = paapi( conf, cgi.params ) | |
| - print header | |
| - print body | |
| + url = paapi(conf, cgi.params) | |
| + print cgi.header({'status' => '302', 'Location' => url}) | |
| rescue | |
| print "Status: 500\nContent-Type: text/plain\n\n" | |
| print $!.message | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment