Skip to content

Instantly share code, notes, and snippets.

@iwadon
Created July 21, 2009 16:42
Show Gist options
  • Select an option

  • Save iwadon/151451 to your computer and use it in GitHub Desktop.

Select an option

Save iwadon/151451 to your computer and use it in GitHub Desktop.
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