📄 rubyamf_controller.rb
字号:
class RubyamfController < ActionController::Base include RubyAMF::App def gateway RequestStore.rails_authentication = {} #clear auth hash RequestStore.rails_request = request RequestStore.rails_response = response RequestStore.gzip = request.env['ACCEPT_ENCODING'].to_s.match(/gzip,[\s]{0,1}deflate/) #compression #if not flash user agent, send some html content amf_response = if request.env['CONTENT_TYPE'].to_s.match(/x-amf/) headers['Content-Type'] = "application/x-amf" RailsGateway.new.service(request.env["RAW_POST_DATA"]) #send the raw data throught the rubyamf gateway and create the response else welcome_screen_html # load in some stub html end render :text => amf_response #render the AMF rescue Exception => e #only errors in this scope will ever be rescued here, see BatchFiler STDOUT.puts e.to_s STDOUT.puts e.backtrace end def rescue_action(e) #There are a couple things that will trigger this rescue_action. Which aren't #ever returned to the flash player. be ware. but I will put a fix for this in. puts "/rubyamf/gateway/render_action" puts e.message puts e.backtrace end private def welcome_screen_html "<html><head><title>RubyAMF Gateway</title> <style>body{margin:0;padding:0;font:12px sans-serif;color:#c8c8c8}td{font:12px sans-serif}</style></head><body bgcolor='#222222'> <table width='100%' align=center valign=middle height='100%'><tr><td width=100 align=center> <a href='http://blog.rubyamf.org'><img border=0 src='http://blog.rubyamf.org/images/gateway.png' /></a>" endend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -