Merge pull request #123 from 5apps/bugfix/head_content_length
Set the Content-Length on HEAD requests
This commit is contained in:
commit
15ff64ea9e
@ -47,6 +47,7 @@ module RemoteStorage
|
||||
server.headers["ETag"] = %Q("#{metadata["e"]}")
|
||||
server.headers["Last-Modified"] = Time.at(metadata["m"].to_i / 1000).httpdate
|
||||
server.headers["Content-Type"] = metadata["t"]
|
||||
server.headers["Content-Length"] = metadata["s"]
|
||||
|
||||
if none_match.include? %Q("#{metadata["e"]}")
|
||||
server.halt 304
|
||||
|
||||
@ -616,6 +616,7 @@ shared_examples_for 'a REST adapter' do
|
||||
last_response.headers["Cache-Control"].must_equal "no-cache"
|
||||
last_response.headers["Last-Modified"].must_equal "Fri, 04 Mar 2016 12:20:18 GMT"
|
||||
last_response.headers["Content-Type"].must_equal "text/plain; charset=utf-8"
|
||||
last_response.headers["Content-Length"].must_equal "2"
|
||||
end
|
||||
|
||||
it "responds with 304 when IF_NONE_MATCH header contains the ETag" do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user