User:Richard/notes

From OpenStreetMap Wiki
Jump to: navigation, 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