Return empty body in OPTIONS requests

This commit is contained in:
Maciej Szlosarczyk 2018-10-16 09:47:33 +03:00
parent 58c928226d
commit e3c83c601c
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
2 changed files with 7 additions and 1 deletions

View file

@ -5,7 +5,7 @@ module Api
def cors_preflight_check
set_access_control_headers
render json: { status: :ok }
render text: ''
end
def set_access_control_headers

View file

@ -18,4 +18,10 @@ class RegistrantApiCorsHeadersTest < ApplicationIntegrationTest
response.headers['Access-Control-Allow-Headers'])
assert_equal('3600', response.headers['Access-Control-Max-Age'])
end
def test_returns_empty_body
options '/api/v1/registrant/auth/eid', {}
assert_equal('', response.body)
end
end