1

IE で「201 Created」を返す POST リクエストに応答して、Flash から 2032 ストリーム エラーが発生します (Firefox は正常に動作します)。Flash は HTTP ステータスへのアクセスを提供しないため、実際に成功したかどうかわかりません。リクエストは HTTPService で行われています。

助言がありますか?他の誰かがこれを見たことがありますか?

ありがとう、アレックス

4

2 に答える 2

4

Flex on Rails アプリケーションでこれを回避する方法を見つけました。IE でも同じ問題が発生していました。Rails の development.log には 201 メッセージが表示されましたが、これにより Flex にエラーが返されました。Tony Hillerson と Daniel Wanja によるFlex On Railsという新しい本で、参考文献を見つけました。31. 201 エラーをキャッチし、ヘッダーを変更する必要があります。ここに私の ApplicationController ファイルがあります:

 class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time
  include AuthenticatedSystem
  before_filter :login_required


  after_filter :flex_error_handling
  def flex_error_handling
    response.headers['Status'] = interpret_status(200) if response.headers['Status'] == interpret_status(422)
    response.headers['Status'] = interpret_status(200) if response.headers['Status'] == interpret_status(201)
  end
  def rescue_action_in_public(exception)
    render_exception(exception)


  end
  def rescue_action_locally(exception)
    render_exception(exception)
  end
    rescue_from ActiveRecord::RecordNotFound, :with => :render_exception
  def render_exception(exception)
    render :text => "<errors><error>#{exception}</error></errors>", :status => 200
  end
end

422 ステータス メッセージを 200 に変更するアクションは、無効なレコード エラーが Flex UI に送り返されるように、2032 ストリーム エラーをよりわかりやすいものに変更するという Hillerman/Wanja の最初の提案の一部でした。

于 2009-01-01T02:53:47.997 に答える
1

トラフィックをのぞくためにデバッグ プロキシを使用してみてください。私はCharlesが好きです。

于 2008-12-10T07:14:17.597 に答える