Apache Jackrabbit 在 WebDAV 匿名访问中抛出 403

标签 apache webdav http-status-code-403 jackrabbit jcr

我将 Apache Jackrabbit 2.6.3 配置为以匿名模式使用 WebDAV(空凭据映射到 anonymous:anonymous)。

如果我单击某个文件(例如 JPG 或 DOC)的直接链接,GlassFish 服务器会抛出 HTTP 403 错误。如果我按 F5,403 仍然存在。

403 error

但是,如果我只需在浏览器的地址栏中按相同 URL 的 Enter,一切都会正常,并且可以访问资源。

我认为唯一的区别是 HTTP header 中的引用者。
我搜索了有关类似问题的任何信息,但找不到任何内容。

是否有人知道如何强制 WebDAV(或 Jackrabbit)以匿名模式提供文件,尽管存在引荐来源网址或任何其他原因?

最佳答案

我找到了解决方案。
web.xml 文件的 WebDAV 部分中,必须取消注释以下部分:

<init-param>
        <param-name>csrf-protection</param-name>
        <param-value>disabled</param-value>
</init-param>

disabled作为param-value

正如描述所说:

Defines the behaviour of the referrer based CSRF protection
1) If omitted or left empty the (default) behaviour is to allow only requests with
an empty referrer header or a referrer host equal to the server host
2) May also contain a comma separated list of additional allowed referrer hosts
3) If set to 'disabled' no referrer checking will be performed at all

关于Apache Jackrabbit 在 WebDAV 匿名访问中抛出 403,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18331871/

相关文章:

java - 如何使用 sardine 从 webdav 服务器下载 zip 文件?

apache - 使用句点重定向目录以查询 htaccess 中的字符串

apache - 在 Ubuntu 12.04 上的 Apache 上配置 SVN 服务器

Apache 计时码 : how to access web ui

.net - 该路径可能与 WebDAV 中的文件名无关

apache - htaccess 403 尝试使用 ErrorDocument 时遇到禁止错误

http - Instagram/feed API 媒体 URL 显示 'URL signature expired'

image - 从网站获取图片时出现403错误

java - 如何将 Apache-Solr 服务器作为后台进程运行?

php - 在调用 php 之前如何在 apache 中设置 REMOTE_ADDR?