在javascript文件上找到501 Method Not Found错误 - 更改名称然后工作 - 为什么? [英] 501 Method Not Found error on a javascript file - change name and it then works - why?

查看:279
本文介绍了在javascript文件上找到501 Method Not Found错误 - 更改名称然后工作 - 为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Ruby on Rails应用程序,并且有一个名为jquery.cookie.js的文件,没有客户端机器下载,因为服务器发回501 Method Not Implemented错误。

I'm working on a Ruby on Rails application, and there is a file called jquery.cookie.js that no client machine downloads because the server sends back a "501 Method Not Implemented" error.

这在我的开发机器上不会发生。不幸的是,我对这个特殊系统非常陌生,并且作为唯一的开发人员(没有与之前的开发人员联系),我很难过甚至可能导致这种情况。

This doesn't happen on my development machine. Unfortunately, I'm extremely new to this particular system and as the only developer (with no contact with the previous developer) I'm stumped as to what could even be the cause of this.

我的问题是 - 什么可能导致这个特定的javascript文件无法下载?其他人那样做。当我重命名文件(类似于jquery.cookee.js)时,它会毫无问题地下载。显然,我不能这样做作为一个永久的解决方案,因为代码中有太多的地方使用它,我害怕通过更改其名称来破坏别的东西。

My question is - what might cause this particular javascript file to not download? The other ones do. When I rename the file (to something like jquery.cookee.js) it downloads without issue. Obviously, I can't do that as a permanent solution as there are too many spots in the code that use it and I'd be afraid to mucking up something else by changing its name.

我们非常感谢您的想法。

Ideas are of course extremely appreciated.

推荐答案

我终于想通了 - mod_security(apache的扩展)继续在jquery.cookie.js中抓住cookie一词,并将该文件标记为潜在威胁,并拒绝提供。

I finally figured it out - mod_security (an extension for apache) kept catching the word "cookie" in "jquery.cookie.js" and marking that file as a potential threat, and refused to serve it up.

重命名文件和放大器;对它的引用最终是必要的。我宁愿单独留下mod_security。

Renaming the file & references to it ended up being necessary. I'd rather leave mod_security alone.

这篇关于在javascript文件上找到501 Method Not Found错误 - 更改名称然后工作 - 为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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