Add CORS headers
This commit is contained in:
parent
d0e78e9fe4
commit
e338e93f5b
@ -28,6 +28,9 @@ class LiquorCabinet < Sinatra::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
before "/:user/:category/:key" do
|
before "/:user/:category/:key" do
|
||||||
|
headers 'Access-Control-Allow-Origin' => '*',
|
||||||
|
'Access-Control-Allow-Methods' => 'GET, PUT, DELETE'
|
||||||
|
|
||||||
@user, @category, @key = params[:user], params[:category], params[:key]
|
@user, @category, @key = params[:user], params[:category], params[:key]
|
||||||
token = env["HTTP_AUTHORIZATION"] ? env["HTTP_AUTHORIZATION"].split(" ")[1] : ""
|
token = env["HTTP_AUTHORIZATION"] ? env["HTTP_AUTHORIZATION"].split(" ")[1] : ""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user