[dokuwiki] Re: AJAX Request content-type

  • From: "Martin Tschofen" <martin.tschofen@xxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Fri, 16 Feb 2007 21:10:22 -0600

I'm going out on a limb here. To change all requests to a Post, try adding
this line above line 87 (if (this.method == "GET") {)in your tw-sack.js.
this.method = "POST";


I really don't know if this solves your problem...martin

On 2/16/07, guifa@xxxxxxxxxxx <guifa@xxxxxxxxxxx> wrote:

Unfortunately my knowledge of PHP/JS coding is limitted, and after
about 30-45 minutes of searching through the code I haven't found a
solution yet.

Recently, the administrators of my server (a University one, so I
can't ask them to change it back) decided that certain requests would
be denied in order to cut down on spam.  To be honest I had no idea
an AJAX request looked any different than a normal HTTP request, but
apparently they do =\

When I enquired as to what broke the media manager and auto-draft
saving features, etc, I got the response that

"Hi Matt, a change was recently made to the mod_security settings to
try to cut down on comment spam.  You may need to do some research to
figure out how to fix your site, but this should put you on the
track.  You'll probably need to change your code to use a different
content type.

The mod_security rule that is stopping your code is :

# Only accept request encodings we know how to handle
# we exclude GET requests from this because some (automated)
# clients supply "text/html" as Content-Type
SecFilterSelective REQUEST_METHOD "!^GET$" chain
SecFilterSelective HTTP_Content-Type "!(^$|^application/x-www-form-
urlencoded$|^multipart/form-data)""

I think I may have found the area in the tw-sack.js file, around
lines 87-97, but I'm not sure if there's any easy way to convert a
request from GET to POST?

Matthew Stuckwisch

--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: