User:Richard/notes
Jump to navigation
Jump to search
Patch to application_controller.rb to get round Flash Player's inability to read response bodies in non-200 responses:
167,168c167,175 < response.headers['Error'] = message < render :text => message, :status => status --- > if request.headers['X-Cloak-Errors-As-200'] > # For broken clients (e.g. Flash Player) that can't access the > # response unless status code is 200 > render :text => "ERROR: #{status}: #{message}" > else > # Standard behaviour > response.headers['Error'] = message > render :text => message, :status => status > end