阿帕奇可以被配置为忽略OPTIONS请求? [英] Can apache be configured to ignore OPTIONS requests?

查看:277
本文介绍了阿帕奇可以被配置为忽略OPTIONS请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跑在工作中几个部门,这是非常低的流量,并没有很多用户的小的web应用。它是建立在Django的顶部,使用Apache作为Web服务器。
我有事情时配置的错误而出现直到昨天是一个伟大的事情给我发电子邮件 - 没有很多的错误,但是有时候,当他们遇到问题的用户不说话,所以它可以让我保持对事物的顶部

I run a small webapp for a couple of departments at work, which is very low traffic and doesn't have that many users. It's built on top of Django and uses apache as the web server. I have things configured to email me when any errors occur which until yesterday was a great thing - there aren't many errors, but sometimes the users don't speak up when they encounter problems, so it allows me to stay on top of things.

昨天我们有一个新的用户,我开始吨错误的电子邮件。他不知道任何事情是错误的,所以我想这是在幕后的东西。当我看着日志,它们是使用Microsoft数据访问Internet发布提供协议和的Microsoft Office协议发现HTTP OPTIONS请求。我从来没有听说过这个直到这一点,但它似乎是某种MS Web文件夹/ WEBDAV的事情。

Yesterday we had a new user, and I started getting tons of error emails. He had no idea that anything was wrong, so I figured it was something behind the scenes. When I looked at the logs, they are HTTP OPTIONS requests which are using the "Microsoft Data Access Internet Publishing Provider Protocol" and "Microsoft Office Protocol Discovery". I'd never heard of this until that point, but it appears to be some sort of MS web folders/webDAV thing.

一种选择是要弄清楚他怎么可以将其关闭,并告诉他停止这样做,但我宁愿只剪头了这里,做一些喜欢Django是的Apache只是没有通过对这些请求有一种方式,这是可以处理的?

One option is to figure out how he can turn that off and tell him to stop doing that, but I'd rather just cut the head off here and do something like have apache just not pass on those requests to Django Is there a way that this can be handled?

推荐答案

我发现了一个不同的框架,并移植到Django的使用的解决方案。我把这个在任何视图的顶部产生链接到.xls或.doc文件HTML:

I found a solution used by a different framework and ported to Django. I place this at the top of any view that generate HTML with links to .XLS or .DOC files:

if request.method == 'OPTIONS':
    response = HttpResponse()
    response['Allow'] = 'GET, HEAD, POST'
    return response

我喜欢Apache的解决方案虽然好......假设它不会导致对事物的Windows方面的问题。

I like Apache solution better though... assuming it doesn't cause problems on the Windows side of things.

这篇关于阿帕奇可以被配置为忽略OPTIONS请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆