Skip to content

Commit be1a639

Browse files
committed
v6.0.4185
1 parent c97e827 commit be1a639

File tree

123 files changed

+654
-1042
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+654
-1042
lines changed

CS/CalDAVServer.FileSystemStorage.AspNet/CalDAVServer.FileSystemStorage.AspNet.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
77
<ProductVersion>9.0.30729</ProductVersion>
88
<SchemaVersion>2.0</SchemaVersion>
9-
<ProjectGuid>1B5A9861-8A45-495B-9EEF-1609A55CF24F</ProjectGuid>
9+
<ProjectGuid>E235F641-F4CF-49C7-B088-374282C6EF3C</ProjectGuid>
1010
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
1111
<OutputType>Library</OutputType>
1212
<AppDesignerFolder>Properties</AppDesignerFolder>
@@ -123,10 +123,10 @@
123123
</ItemGroup>
124124
<ItemGroup>
125125
<Reference Include="ITHit.WebDAV.Server">
126-
<HintPath>..\packages\ITHit.WebDAV.Server.6.0.4108\lib\net451\ITHit.WebDAV.Server.dll</HintPath>
126+
<HintPath>..\packages\ITHit.WebDAV.Server.6.0.4185\lib\net451\ITHit.WebDAV.Server.dll</HintPath>
127127
</Reference>
128128
<Reference Include="ITHit.WebDAV.Server.Web">
129-
<HintPath>..\packages\ITHit.WebDAV.Server.Web.6.0.4108\lib\net451\ITHit.WebDAV.Server.Web.dll</HintPath>
129+
<HintPath>..\packages\ITHit.WebDAV.Server.Web.6.0.4185\lib\net451\ITHit.WebDAV.Server.Web.dll</HintPath>
130130
</Reference>
131131
</ItemGroup>
132132
<PropertyGroup>
@@ -144,7 +144,7 @@
144144
<AutoAssignPort>True</AutoAssignPort>
145145
<DevelopmentServerPort>9658</DevelopmentServerPort>
146146
<DevelopmentServerVPath>/</DevelopmentServerVPath>
147-
<IISUrl>http://localhost:17867/</IISUrl>
147+
<IISUrl>http://localhost:4658/</IISUrl>
148148
<NTLMAuthentication>True</NTLMAuthentication>
149149
<UseCustomServer>False</UseCustomServer>
150150
<CustomServerUrl>

CS/CalDAVServer.FileSystemStorage.AspNet/MyCustomGetHandler.cs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -106,62 +106,12 @@ public async Task ProcessRequestAsync(DavContextBaseAsync context, IHierarchyIte
106106
await Task.Factory.FromAsync(page.BeginProcessRequest, page.EndProcessRequest, HttpContext.Current, null);
107107
}
108108
}
109-
else if (urlPath.StartsWith("/AjaxFileBrowser/") || urlPath.StartsWith("/wwwroot/"))
110-
{
111-
// The "/AjaxFileBrowser/" and "/wwwroot/" are not a WebDAV folders. They can be used to store client script files,
112-
// images, static HTML files or any other files that does not require access via WebDAV.
113-
// Any request to the files in this folder will just serve them to the client.
114-
115-
await context.EnsureBeforeResponseWasCalledAsync();
116-
string filePath = Path.Combine(htmlPath, urlPath.TrimStart('/').Replace('/', Path.DirectorySeparatorChar));
117-
118-
// Remove query string.
119-
int queryIndex = filePath.LastIndexOf('?');
120-
if (queryIndex > -1)
121-
{
122-
filePath = filePath.Remove(queryIndex);
123-
}
124-
125-
if (!File.Exists(filePath))
126-
{
127-
throw new DavException("File not found: " + filePath, DavStatus.NOT_FOUND);
128-
}
129-
130-
using (TextReader reader = File.OpenText(filePath))
131-
{
132-
string html = await reader.ReadToEndAsync();
133-
await WriteFileContentAsync(context, html, filePath);
134-
}
135-
}
136109
else
137110
{
138111
await OriginalHandler.ProcessRequestAsync(context, item);
139112
}
140113
}
141114

142-
/// <summary>
143-
/// Writes HTML to the output stream in case of GET request using encoding specified in Engine.
144-
/// Writes headers only in case of HEAD request.
145-
/// </summary>
146-
/// <param name="context">Instace of <see cref="DavContextBaseAsync"/>.</param>
147-
/// <param name="content">String representation of the content to write.</param>
148-
/// <param name="filePath">Relative file path, which holds the content.</param>
149-
private async Task WriteFileContentAsync(DavContextBaseAsync context, string content, string filePath)
150-
{
151-
Encoding encoding = context.Engine.ContentEncoding; // UTF-8 by default
152-
context.Response.ContentLength = encoding.GetByteCount(content);
153-
context.Response.ContentType = string.Format("{0}; charset={1}", MimeType.GetMimeType(Path.GetExtension(filePath)) ?? "application/octet-stream", encoding.WebName);
154-
155-
// Return file content in case of GET request, in case of HEAD just return headers.
156-
if (context.Request.HttpMethod == "GET")
157-
{
158-
using (var writer = new StreamWriter(context.Response.OutputStream, encoding))
159-
{
160-
await writer.WriteAsync(content);
161-
}
162-
}
163-
}
164-
165115
/// <summary>
166116
/// This handler shall only be invoked for <see cref="IFolderAsync"/> items or if original handler (which
167117
/// this handler substitutes) shall be called for the item.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="ITHit.WebDAV.Server" version="6.0.4108" targetFramework="net451" />
4-
<package id="ITHit.WebDAV.Server.Web" version="6.0.4108" targetFramework="net451" />
3+
<package id="ITHit.WebDAV.Server" version="6.0.4185" targetFramework="net451" />
4+
<package id="ITHit.WebDAV.Server.Web" version="6.0.4185" targetFramework="net451" />
55
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net451" />
66
</packages>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<system.webServer>
4+
<handlers>
5+
<add name="StaticFile" verb="*" path="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" preCondition="integratedMode" />
6+
</handlers>
7+
</system.webServer>
8+
</configuration>
0 Bytes
Binary file not shown.
Binary file not shown.

CS/CalDAVServer.SqlStorage.AspNet/CalDAVServer.SqlStorage.AspNet.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
77
<ProductVersion>9.0.30729</ProductVersion>
88
<SchemaVersion>2.0</SchemaVersion>
9-
<ProjectGuid>A1382FB5-4AA0-4015-AB24-B44C5A80783F</ProjectGuid>
9+
<ProjectGuid>F6E603C1-3F98-439F-A3E2-6A2A1A740206</ProjectGuid>
1010
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
1111
<OutputType>Library</OutputType>
1212
<AppDesignerFolder>Properties</AppDesignerFolder>
@@ -111,10 +111,10 @@
111111
</ItemGroup>
112112
<ItemGroup>
113113
<Reference Include="ITHit.WebDAV.Server">
114-
<HintPath>..\packages\ITHit.WebDAV.Server.6.0.4108\lib\net451\ITHit.WebDAV.Server.dll</HintPath>
114+
<HintPath>..\packages\ITHit.WebDAV.Server.6.0.4185\lib\net451\ITHit.WebDAV.Server.dll</HintPath>
115115
</Reference>
116116
<Reference Include="ITHit.WebDAV.Server.Web">
117-
<HintPath>..\packages\ITHit.WebDAV.Server.Web.6.0.4108\lib\net451\ITHit.WebDAV.Server.Web.dll</HintPath>
117+
<HintPath>..\packages\ITHit.WebDAV.Server.Web.6.0.4185\lib\net451\ITHit.WebDAV.Server.Web.dll</HintPath>
118118
</Reference>
119119
</ItemGroup>
120120
<PropertyGroup>
@@ -132,7 +132,7 @@
132132
<AutoAssignPort>True</AutoAssignPort>
133133
<DevelopmentServerPort>9658</DevelopmentServerPort>
134134
<DevelopmentServerVPath>/</DevelopmentServerVPath>
135-
<IISUrl>http://localhost:18863/</IISUrl>
135+
<IISUrl>http://localhost:25597/</IISUrl>
136136
<NTLMAuthentication>False</NTLMAuthentication>
137137
<UseCustomServer>False</UseCustomServer>
138138
<CustomServerUrl>

CS/CalDAVServer.SqlStorage.AspNet/MyCustomGetHandler.cs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -106,62 +106,12 @@ public async Task ProcessRequestAsync(DavContextBaseAsync context, IHierarchyIte
106106
await Task.Factory.FromAsync(page.BeginProcessRequest, page.EndProcessRequest, HttpContext.Current, null);
107107
}
108108
}
109-
else if (urlPath.StartsWith("/AjaxFileBrowser/") || urlPath.StartsWith("/wwwroot/"))
110-
{
111-
// The "/AjaxFileBrowser/" and "/wwwroot/" are not a WebDAV folders. They can be used to store client script files,
112-
// images, static HTML files or any other files that does not require access via WebDAV.
113-
// Any request to the files in this folder will just serve them to the client.
114-
115-
await context.EnsureBeforeResponseWasCalledAsync();
116-
string filePath = Path.Combine(htmlPath, urlPath.TrimStart('/').Replace('/', Path.DirectorySeparatorChar));
117-
118-
// Remove query string.
119-
int queryIndex = filePath.LastIndexOf('?');
120-
if (queryIndex > -1)
121-
{
122-
filePath = filePath.Remove(queryIndex);
123-
}
124-
125-
if (!File.Exists(filePath))
126-
{
127-
throw new DavException("File not found: " + filePath, DavStatus.NOT_FOUND);
128-
}
129-
130-
using (TextReader reader = File.OpenText(filePath))
131-
{
132-
string html = await reader.ReadToEndAsync();
133-
await WriteFileContentAsync(context, html, filePath);
134-
}
135-
}
136109
else
137110
{
138111
await OriginalHandler.ProcessRequestAsync(context, item);
139112
}
140113
}
141114

142-
/// <summary>
143-
/// Writes HTML to the output stream in case of GET request using encoding specified in Engine.
144-
/// Writes headers only in case of HEAD request.
145-
/// </summary>
146-
/// <param name="context">Instace of <see cref="DavContextBaseAsync"/>.</param>
147-
/// <param name="content">String representation of the content to write.</param>
148-
/// <param name="filePath">Relative file path, which holds the content.</param>
149-
private async Task WriteFileContentAsync(DavContextBaseAsync context, string content, string filePath)
150-
{
151-
Encoding encoding = context.Engine.ContentEncoding; // UTF-8 by default
152-
context.Response.ContentLength = encoding.GetByteCount(content);
153-
context.Response.ContentType = string.Format("{0}; charset={1}", MimeType.GetMimeType(Path.GetExtension(filePath)) ?? "application/octet-stream", encoding.WebName);
154-
155-
// Return file content in case of GET request, in case of HEAD just return headers.
156-
if (context.Request.HttpMethod == "GET")
157-
{
158-
using (var writer = new StreamWriter(context.Response.OutputStream, encoding))
159-
{
160-
await writer.WriteAsync(content);
161-
}
162-
}
163-
}
164-
165115
/// <summary>
166116
/// This handler shall only be invoked for <see cref="IFolderAsync"/> items or if original handler (which
167117
/// this handler substitutes) shall be called for the item.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="ITHit.WebDAV.Server" version="6.0.4108" targetFramework="net451" />
4-
<package id="ITHit.WebDAV.Server.Web" version="6.0.4108" targetFramework="net451" />
3+
<package id="ITHit.WebDAV.Server" version="6.0.4185" targetFramework="net451" />
4+
<package id="ITHit.WebDAV.Server.Web" version="6.0.4185" targetFramework="net451" />
55
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net451" />
66
</packages>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<system.webServer>
4+
<handlers>
5+
<add name="StaticFile" verb="*" path="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" preCondition="integratedMode" />
6+
</handlers>
7+
</system.webServer>
8+
</configuration>

0 commit comments

Comments
 (0)