mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 20:55:44 +02:00
Return empty body in OPTIONS requests
This commit is contained in:
parent
58c928226d
commit
e3c83c601c
2 changed files with 7 additions and 1 deletions
|
@ -5,7 +5,7 @@ module Api
|
||||||
|
|
||||||
def cors_preflight_check
|
def cors_preflight_check
|
||||||
set_access_control_headers
|
set_access_control_headers
|
||||||
render json: { status: :ok }
|
render text: ''
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_access_control_headers
|
def set_access_control_headers
|
||||||
|
|
|
@ -18,4 +18,10 @@ class RegistrantApiCorsHeadersTest < ApplicationIntegrationTest
|
||||||
response.headers['Access-Control-Allow-Headers'])
|
response.headers['Access-Control-Allow-Headers'])
|
||||||
assert_equal('3600', response.headers['Access-Control-Max-Age'])
|
assert_equal('3600', response.headers['Access-Control-Max-Age'])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_returns_empty_body
|
||||||
|
options '/api/v1/registrant/auth/eid', {}
|
||||||
|
|
||||||
|
assert_equal('', response.body)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue