aboutsummaryrefslogtreecommitdiff
path: root/doc/forum/error_302___40__Found__41___when_editing_page.mdwn
blob: aa2db2f8a47c9e0c80d41c75df91cf52b02c8ee2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
I have an [IkiWiki site](http://ocikbapps.uzh.ch/gc3wiki), which works
fine, except for one page which I cannot edit with the CGI.  Only this
single page is failing, editing every other works as expected.

When clicking every button (well, except "Cancel") on the edit form, I
get a "302 Found" page in the browser; the Apache logs show:

    [client XXX] malformed header from script. Bad header=according%20to%20the%20availab: ikiwiki.cgi

Capturing the output from `ikiwiki.cgi`, I see that just these two
lines are sent:

    Status: 302 Found
    Location: https://ocikbapps.uzh.ch/gc3wiki/ikiwiki.auth.cgi?_submitted=1;do=edit;..;_submit=Preview;attachment=

The total size in bytes of the reply is 16189; I thought this might be
an issue with Apache imposing some limit on the header size; indeed,
`tcpflow` shows that the "302 Found" message is encapsulated into an
HTTP 500 "internal server error" response.

So I added this to Apache's config (std Debian 6.0):

    # cat /etc/apache2/conf.d/limits.conf
    LimitRequestFieldSize 65534
    LimitRequestLine 65534

But I'm still getting the same error.

Any suggestions?


**Update 2011-08-16:** 
[This bug report](https://bugzilla.mozilla.org/show_bug.cgi?id=513989) 
shows the exact same symptoms; the solution they adopted is to not
perform the redirect when the URL length exceeds the default Apache
value of 8190.

Regarding Apache limits: apparently, Apache (as of version 2.2.17)
only applies the `LimitRequestLine` and `LimitRequestFiledsize` in
client HTTP transactions; when dealing with the HTTP responses
generated by CGI scripts, the code from `server/util_script.c`
applies: (function `ap_scan_script_header_err_core`, lines 403--433)

        char x[MAX_STRING_LEN];
        char *w, *l;
        [...]
        if (buffer) {
            *buffer = '\0';
        }
        w = buffer ? buffer : x;
        [...]
        while (1) {
            int rv = (*getsfunc) (w, MAX_STRING_LEN - 1, getsfunc_data);

where `MAX_STRING_LEN` is defined in `httpd.h` to be equal to
`HUGE_STRING_LEN`, that is, 8192.

> This has been filed as [[!debbug 638009]], so let's only
> discuss it in one place (ie, there) --[[Joey]]