mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
webdav: awful hack to fix VSC plugin
This commit is contained in:
parent
91055a2feb
commit
6e49ac23cd
1 changed files with 11 additions and 0 deletions
11
config.ru
11
config.ru
|
@ -68,6 +68,17 @@ map '/webdav' do
|
||||||
|
|
||||||
env['PATH_INFO'] = "/#{@site.scrubbed_path(path)}" unless path.empty?
|
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('<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<propfind xmlns="DAV:"><prop>
|
||||||
|
<getcontentlength xmlns="DAV:"/>
|
||||||
|
<getlastmodified xmlns="DAV:"/>
|
||||||
|
<resourcetype xmlns="DAV:"/>
|
||||||
|
</prop></propfind>')
|
||||||
|
env['CONTENT_LENGTH'] = env['rack.input'].length.to_s
|
||||||
|
end
|
||||||
|
|
||||||
DAV4Rack::Handler.new(
|
DAV4Rack::Handler.new(
|
||||||
root: @site.files_path,
|
root: @site.files_path,
|
||||||
root_uri_path: '/webdav'
|
root_uri_path: '/webdav'
|
||||||
|
|
Loading…
Add table
Reference in a new issue