Hi All,
this was causing a couple of people trouble when trying to add code to
Snippetz.net recently, and it may be of use to others, so...
<tip type="Precondition failed errors on TextDrive" author="Ian Anderson">
Users may sometimes receive terse error messages when interacting with
sites hosted on TextDrive (and, perhaps, other ISPs that use mod_security)
e.g. "The precondition on the request for the URL /foo.php evaluated to
false" or HTTP error 412.
This can happen in at least two situations, it seems.
1. From [1]:
"TextDrive uses mod_security to block comment and referrer spam, but
sometimes it gets triggered by mistake. This can happen if something on
your site (like a URL) matches a common pattern (like ”-poker”,
”-pictures”, or ”-sex”)."
In addition to the cases quoted here, it seems other suspicious strings
may trigger mod_security to prevent the HTTP request from being
permitted. In one case, it was the presence of "../" being present in a
snippet that someone was trying to add through a form submission.
We've followed the advice at [1] to prevent this happening again,
because in our situation users must be able to use such strings in their
snippets. We spent some time pulling our code apart to absolutely no
purpose, since as it turned out the form submission didn't even get as
far as our PHP code before the HTTP request was rejected.
2. Kerim Friedman writes [2] of being prevented from seeing certain
sites hosted on TextDrive at all, and of the reason being found to be
that his (dynamically assigned) IP address had been added to a blacklist
that TextDrive check when HTTP requests enter their network. On
appealing to TextDrive, they removed the block. The symptom seems to
have been identical to the previous issue, though.
[1] http://help.textdrive.com/index.php?pg=kb.page&id=85
[2] http://keywords.oxus.net/archives/2005/05/10/precondition-failed/
Hope this helps others perplexed by this error message.
</tip>
--
_________________________________________________
zStudio - Web development and accessibility
http://zStudio.co.uk
Snippetz.net - Online code library
File, manage and re-use your code snippets & links
http://snippetz.net