return 404 for missing file on rename

This commit is contained in:
Kyle Drake 2024-08-20 11:17:29 -05:00
parent a148f87701
commit 9ad4b27a50

View file

@ -52,6 +52,7 @@ map '/webdav' do
env['PATH_INFO'] = env['PATH_INFO'][1..env['PATH_INFO'].length] if env['PATH_INFO'][0] == '/'
site_file = @site.site_files.select {|s| s.path == env['PATH_INFO']}.first
return [404, {}, ['']] if site_file.nil?
res = site_file.rename destination
return [201, {}, ['']]