To fix issues with Safari frequently hanging when uploading files, I need to make a request to my Rails server and have it return an empty body with a "Connection: close" header. More details about this fix can be found here.
So far, I have tried:
def close
return head :ok, {'Connection' => 'close'}
end
def close
response.headers['Connection'] = 'close'
render :nothing => true
end
def close
response.headers['Connection'] = 'close'
return head :ok
end
None of these approaches seem to work. Inspecting the request in Firebug and Safari's developer console reveals that the response header, Connection, is always set to "keep-alive"
I'm running Rails 2.3.5 with Mongrel and Nginx. Setting a header such as Content-Type does work by the way.
Any ideas on how to fix this?