Merge branch 'dav2fs-fix'

This commit is contained in:
Kyle Drake
2025-12-23 20:22:55 -06:00
2 changed files with 7 additions and 2 deletions
+6 -2
View File
@@ -46,7 +46,7 @@ map '/webdav' do
case request_method
when 'OPTIONS'
return [200, {'Allow' => 'OPTIONS, GET, HEAD, PUT, DELETE, PROPFIND, MKCOL, MOVE', 'DAV' => '1,2'}, ['']]
return [200, {'Allow' => 'OPTIONS, GET, HEAD, PUT, DELETE, PROPFIND, MKCOL, MOVE', 'DAV' => '1'}, ['']]
when 'GET', 'HEAD'
begin
@@ -86,6 +86,10 @@ map '/webdav' do
'Last-Modified' => last_modified.httpdate
}
if site_file&.sha1_hash
headers['ETag'] = %("#{site_file.sha1_hash}")
end
if request_method == 'HEAD'
return [200, headers, []]
end
@@ -205,7 +209,7 @@ map '/webdav' do
</D:multistatus>
XML
return [207, {'Content-Type' => 'application/xml; charset=utf-8', 'DAV' => '1,2'}, [xml]]
return [207, {'Content-Type' => 'application/xml; charset=utf-8', 'DAV' => '1'}, [xml]]
when 'PUT'
tmpfile = Tempfile.new('davfile', encoding: 'binary')
+1
View File
@@ -1306,6 +1306,7 @@ class Site < Sequel::Model
file[:size] = site_file.size unless file[:is_directory]
file[:created_at] = site_file.created_at
file[:updated_at] = site_file.updated_at ? site_file.updated_at : site_file.created_at
file[:sha1_hash] = site_file.sha1_hash
end
file[:is_html] = !(extname.match(HTML_REGEX)).nil?