Allow Content-Length header to be received and sent in CORS requests

This commit is contained in:
Thibault Jouan
2012-04-19 20:38:50 +00:00
parent b40b4d4df3
commit 9ccd1e10be
3 changed files with 6 additions and 3 deletions

View File

@@ -9,11 +9,13 @@ class Api::ApplicationController < ApplicationController
request.headers['Origin'] :
''
headers['Access-Control-Allow-Credentials'] = 'true'
headers['Access-Control-Expose-Headers'] = 'Content-Length'
end
def cor_preflight
headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, DELETE'
headers['Access-Control-Allow-Headers'] = 'Content-Type, X-Requested-With'
headers['Access-Control-Allow-Headers'] =
'Content-Type, Content-Length, X-Requested-With'
head :ok
end