Remove "test" route

This commit is contained in:
Michael Vesely 2026-10-22 11:47:39 +02:00
parent ef02c896c7
commit 9a16e87ca5

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net;
using System.Net.Http;
@ -11,18 +12,14 @@ using WebDAVSharp.Server.Stores.DiskStore;
namespace WebDAVSharp.WebServer.Controllers {
public class WebDAVController : ApiController {
[Route("test"), HttpGet]
public dynamic Test() {
return new { bla = "blupp", kinz = "kunz" };
}
[Route("webDav/{*FileName}"), AcceptVerbs("OPTIONS", "GET", "HEAD", "PROPFIND", "PROPPATCH", "MKCOL", "PUT", "DELETE", "COPY", "MOVE", "LOCK", "UNLOCK",
"TRACE", "POST")]
[Route("webDav/{*FileName}"),
AcceptVerbs("OPTIONS", "GET", "HEAD", "PROPFIND", "PROPPATCH", "MKCOL", "PUT", "DELETE", "COPY", "MOVE", "LOCK", "UNLOCK", "TRACE", "POST")]
public void WebDav(String FileName) {
var rootPath = @"t:\";
var store = new WebDavDiskStore(rootPath);
var webDavServer = new WebDavServer(store);
webDavServer.ServiceUrl = "http://" + Request.RequestUri.Authority + "/webDAV/"; // trailing slash is important
webDavServer.ServiceUrl = "http://" + Request.RequestUri.Authority + "/webDAV/"; // trailing slash is important //TODO: check protocol HTTP vs. HTTPS
webDavServer.ProcessRequest(HttpContext.Current, FileName);
//HttpContext.Current.Response.Flush();