]> sipb.mit.edu Git - ikiwiki.git/blob - doc/forum/error_302___40__Found__41___when_editing_page.mdwn
Added a comment
[ikiwiki.git] / doc / forum / error_302___40__Found__41___when_editing_page.mdwn
1 I have an [IkiWiki site](http://ocikbapps.uzh.ch/gc3wiki), which works
2 fine, except for one page which I cannot edit with the CGI.  Only this
3 single page is failing, editing every other works as expected.
4
5 When clicking every button (well, except "Cancel") on the edit form, I
6 get a "302 Found" page in the browser; the Apache logs show:
7
8     [client XXX] malformed header from script. Bad header=according%20to%20the%20availab: ikiwiki.cgi
9
10 Capturing the output from `ikiwiki.cgi`, I see that just these two
11 lines are sent:
12
13     Status: 302 Found
14     Location: https://ocikbapps.uzh.ch/gc3wiki/ikiwiki.auth.cgi?_submitted=1;do=edit;..;_submit=Preview;attachment=
15
16 The total size in bytes of the reply is 16189; I thought this might be
17 an issue with Apache imposing some limit on the header size; indeed,
18 `tcpflow` shows that the "302 Found" message is encapsulated into an
19 HTTP 500 "internal server error" response.
20
21 So I added this to Apache's config (std Debian 6.0):
22
23     # cat /etc/apache2/conf.d/limits.conf
24     LimitRequestFieldSize 65534
25     LimitRequestLine 65534
26
27 But I'm still getting the same error.
28
29 Any suggestions?
30
31
32 **Update 2011-08-16:** 
33 [This bug report](https://bugzilla.mozilla.org/show_bug.cgi?id=513989) 
34 shows the exact same symptoms; the solution they adopted is to not
35 perform the redirect when the URL length exceeds the default Apache
36 value of 8190.
37
38 Regarding Apache limits: apparently, Apache (as of version 2.2.17)
39 only applies the `LimitRequestLine` and `LimitRequestFiledsize` in
40 client HTTP transactions; when dealing with the HTTP responses
41 generated by CGI scripts, the code from `server/util_script.c`
42 applies: (function `ap_scan_script_header_err_core`, lines 403--433)
43
44         char x[MAX_STRING_LEN];
45         char *w, *l;
46         [...]
47         if (buffer) {
48             *buffer = '\0';
49         }
50         w = buffer ? buffer : x;
51         [...]
52         while (1) {
53             int rv = (*getsfunc) (w, MAX_STRING_LEN - 1, getsfunc_data);
54
55 where `MAX_STRING_LEN` is defined in `httpd.h` to be equal to
56 `HUGE_STRING_LEN`, that is, 8192.
57
58 > This has been filed as [[!debbug 638009]], so let's only
59 > discuss it in one place (ie, there) --[[Joey]]