From 6e49ac23cd4a93b9eb1325a1592fbdcf0c3d21cb Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Fri, 7 Feb 2025 18:09:28 -0600 Subject: [PATCH] webdav: awful hack to fix VSC plugin --- config.ru | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/config.ru b/config.ru index 5a4346ce..106f834e 100644 --- a/config.ru +++ b/config.ru @@ -68,6 +68,17 @@ map '/webdav' do env['PATH_INFO'] = "/#{@site.scrubbed_path(path)}" unless path.empty? + # Terrible hack to fix WebDAV for the VSC plugin + if env['CONTENT_LENGTH'] == "0" + env['rack.input'] = StringIO.new(' + + + + +') + env['CONTENT_LENGTH'] = env['rack.input'].length.to_s + end + DAV4Rack::Handler.new( root: @site.files_path, root_uri_path: '/webdav'