501 Method Not Found error on a javascript file -

2019-09-01 15:28发布

问题:

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.

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.

回答1:

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.

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