Add OPTIONS resource, allow Content-Type header
This commit is contained in:
parent
30cd0536b2
commit
46c230d0d7
@ -30,7 +30,7 @@ class LiquorCabinet < Sinatra::Base
|
||||
before "/:user/:category/:key" do
|
||||
headers 'Access-Control-Allow-Origin' => '*',
|
||||
'Access-Control-Allow-Methods' => 'GET, PUT, DELETE',
|
||||
'Access-Control-Allow-Headers' => 'Authorization'
|
||||
'Access-Control-Allow-Headers' => 'Authorization, Content-Type'
|
||||
|
||||
@user, @category, @key = params[:user], params[:category], params[:key]
|
||||
token = env["HTTP_AUTHORIZATION"] ? env["HTTP_AUTHORIZATION"].split(" ")[1] : ""
|
||||
@ -55,4 +55,8 @@ class LiquorCabinet < Sinatra::Base
|
||||
delete_data(@user, @category, @key)
|
||||
end
|
||||
|
||||
options "/:user/:category/:key" do
|
||||
halt 200
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user