webdav portal owa editing alpha
This commit is contained in:
parent
7aa68cd775
commit
aedc7ec08e
33 changed files with 969 additions and 153 deletions
|
@ -0,0 +1,24 @@
|
|||
using System.Linq;
|
||||
using System.Web.Http.Controllers;
|
||||
|
||||
namespace WebsitePanel.WebDavPortal.Configurations.ActionSelectors
|
||||
{
|
||||
public class OwaActionSelector : ApiControllerActionSelector
|
||||
{
|
||||
public override HttpActionDescriptor SelectAction(HttpControllerContext controllerContext)
|
||||
{
|
||||
if (controllerContext.Request.Headers.Contains("X-WOPI-Override"))
|
||||
{
|
||||
var matchingHeaders = controllerContext.Request.Headers.GetValues("X-WOPI-Override");
|
||||
var headerValue = (matchingHeaders == null) ? "" : (matchingHeaders.FirstOrDefault() ?? "");
|
||||
|
||||
if (!string.IsNullOrEmpty(headerValue))
|
||||
{
|
||||
controllerContext.RouteData.Values["action"] = headerValue;
|
||||
}
|
||||
}
|
||||
|
||||
return base.SelectAction(controllerContext);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue