-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOfficeWebDavHeadersFilter.cs
More file actions
21 lines (20 loc) · 1.06 KB
/
OfficeWebDavHeadersFilter.cs
File metadata and controls
21 lines (20 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;
using Microsoft.AspNetCore.Mvc.Filters;
namespace OfficeWebDav
{
public class OfficeWebDavHeadersFilter: ActionFilterAttribute
{
public override void OnActionExecuted(ActionExecutedContext context)
{
context.HttpContext.Response.Headers.Add("dav", "1,2");
context.HttpContext.Response.Headers.Add("www-authenticate", "Anonymous");
context.HttpContext.Response.Headers.Add("access-control-allow-origin", "*");
context.HttpContext.Response.Headers.Add("access-control-allow-credentials", "true");
context.HttpContext.Response.Headers.Add("ms-author-via", "DAV");
context.HttpContext.Response.Headers.Add("access-control-expose-headers", "DAV, content-length, Allow");
//context.HttpContext.Response.Headers.Add("allow", "PROPPATCH,PROPFIND,OPTIONS,DELETE,UNLOCK,COPY,LOCK,MOVE,HEAD,POST,PUT,GET");
context.HttpContext.Response.Headers.Add("allow", "OPTIONS,UNLOCK,LOCK,HEAD,PUT,GET");
base.OnActionExecuted(context);
}
}
}