IIS 中的自定义 webdav 实现在 PROPFIND 上给出 405

发布于 2024-12-05 22:23:47 字数 1630 浏览 5 评论 0原文

我使用 HttpHandler 创建了一个自定义 webdav 实现,通过 webdav 协议向客户端提供数据库中的文件。 在我的 VS 开发服务器 Cassini 上,我可以毫无问题地访问它。 现在我尝试在 IIS 中调试该站点,但不起作用。 我卸载了 IIS 7.5 Webdav 模块。

我的 web.config 的一些片段:

<system.web>
...
<httphandlers>
 <add type="Test.WebDAVHandler, Test" verb="*" path="*"></add>
</httphandlers>
...
</system.web>
<system.webserver>
  <modules runAllManagedModulesForAllRequests="true">
      <remove name="WebDAVModule">
  </remove>
</modules>
  <validation validateIntegratedModeConfiguration="true">
<defaultdocument enabled="true">
   <files>
    <add value="example.aspx"></add>
   </files>
  </defaultdocument>
  <handlers accessPolicy="Read,Write,Execute,Script">
      <remove name="WebDAV">
   <add name=".NET Runtime" verb="*" path="*" preCondition="classicMode,runtimeVersionv2.0,bitness64" requireAccess="None" resourceType="Unspecified" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" modules="IsapiModule">
  </add>
</handlers>

 </validation>
</system.webserver>

当我使用 Windows 7 的“映射网络驱动器”选项连接到此站点并使用 Fiddler 检查请求时,我发现经过一些身份验证后,客户端会执行以下请求: 选项 localhost/explorer 并获得以下(缩短的)响应。

HTTP/1.1 200 OK

允许:OPTIONS、TRACE、GET、HEAD、POST

我在这里缺少一些允许的动词,例如 PROPFIND。

客户端执行的下一个请求是 PROPFIND。 服务器响应 405 Method not allowed。 我查看了请求跟踪,发现 DefaultDocumentModule 导致了此错误。 当我禁用此模块时,DirectoryListingModule 会导致此 405。

有谁知道如何解决此问题,以便我可以将 webdav 与我的自定义处理程序一起使用?

I have created a custom webdav implementation with a HttpHandler, to serve files in a database via webdav protocol to a client.
On Cassini, my VS Development server I can access this without problems.
Now I am trying to debug this site in IIS, and that doesn't work.
I have the IIS 7.5 Webdav module uninstalled.

Some snippets of my web.config:

<system.web>
...
<httphandlers>
 <add type="Test.WebDAVHandler, Test" verb="*" path="*"></add>
</httphandlers>
...
</system.web>
<system.webserver>
  <modules runAllManagedModulesForAllRequests="true">
      <remove name="WebDAVModule">
  </remove>
</modules>
  <validation validateIntegratedModeConfiguration="true">
<defaultdocument enabled="true">
   <files>
    <add value="example.aspx"></add>
   </files>
  </defaultdocument>
  <handlers accessPolicy="Read,Write,Execute,Script">
      <remove name="WebDAV">
   <add name=".NET Runtime" verb="*" path="*" preCondition="classicMode,runtimeVersionv2.0,bitness64" requireAccess="None" resourceType="Unspecified" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" modules="IsapiModule">
  </add>
</handlers>

 </validation>
</system.webserver>

When I connect to this site by using the Map network drive option of Windows 7 and inspect the requests using Fiddler, I see that the after some authentication, the client does the following request:
OPTIONS localhost/explorer and gets the following (shortened) response.

HTTP/1.1 200 OK

Allow: OPTIONS, TRACE, GET, HEAD, POST

I am missing some allowed verbs here, like PROPFIND.

The next request the client does is a PROPFIND.
The server responds with a 405 Method not allowed.
I looked at the request tracing, and the DefaultDocumentModule is causing this error.
When I disable this module, the DirectoryListingModule causes this 405.

Does anyone have a clue how to fix this, so that I can use webdav with my custom handler?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文