Add new headers

Add Range to allow headers, Content-Range to expose headers and the
Accept-Ranges header
This commit is contained in:
Greg Karékinian 2020-01-02 18:21:07 +01:00
parent f1b66d3bac
commit ee16f5deb1

View File

@ -68,8 +68,9 @@ class LiquorCabinet < Sinatra::Base
before path do
headers 'Access-Control-Allow-Origin' => '*',
'Access-Control-Allow-Methods' => 'GET, PUT, DELETE',
'Access-Control-Allow-Headers' => 'Authorization, Content-Type, Origin, If-Match, If-None-Match',
'Access-Control-Expose-Headers' => 'ETag, Content-Length'
'Access-Control-Allow-Headers' => 'Authorization, Content-Type, Origin, If-Match, If-None-Match, Range',
'Access-Control-Expose-Headers' => 'ETag, Content-Length, Content-Range',
'Accept-Ranges' => 'bytes'
headers['Access-Control-Allow-Origin'] = env["HTTP_ORIGIN"] if env["HTTP_ORIGIN"]
headers['Cache-Control'] = 'no-cache'