]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/CGI_showed_HTML_when_perl_error.mdwn
web commit by http://willu.myopenid.com/: Add a report linking to initial Monotone...
[ikiwiki.git] / doc / bugs / CGI_showed_HTML_when_perl_error.mdwn
1 I didn't have Time/Duration.pm installed when I clicked RecentChanges. The
2 perl failed. The CGI outputed the Content-type: text/html and the complete
3 HTML which included the error in side of the paragraph tags. Maybe a newline
4 was sent before that Content-type line. The web browser didn't render the HTML
5 but just showed the source.
6
7 > I can't reproduce this, I get a properly formatted error page.
8 > If you'd like to send me the page, I can try to figure out what
9 > happened. --[[Joey]]
10
11 >> The page is fine. I can reproduce by just putting a typo or error in a
12 >> plugin. I used tcpdump. When I am missing plugin I get a newline 0a
13 >> before Content-Type:
14
15     0x0030:  0000 0003 0000 0000 0a43 6f6e 7465 6e74  .........Content
16
17 >> And with it working, no newline:
18
19     0x0030:  0000 0003 0000 0000 436f 6e74 656e 742d  ........Content-
20
21 >> I am using mini_httpd. I guess I could try another webserver real quick.
22 >>
23 >> --JeremyReed
24
25 Here's what I see, taking the web server out of the picture:
26
27         joey@kodama:~>~/html/ikiwiki.cgi 2>/dev/null |hexdump -C|head -1
28         00000000  43 6f 6e 74 65 6e 74 2d  74 79 70 65 3a 20 74 65 |Content-type: te|
29
30 No spurious 0a. With apache:
31
32         0100  75 6e 6b 65 64 0d 0a 43  6f 6e 74 65 6e 74 2d 54   unked..C ontent-T
33
34 Here the 0d 0a is a CRLF, and note that it's output by the web server, not
35 ikiwiki. It's perfectly valid, while a lone 0a, just a linefeed, is not valid
36 HTTP. Conclusion, this was your web server; it's not uncommon for hacky
37 little web servers to not use proper CRLF's, and it works _some_ of the time,
38 depending on how strict the browser is.
39
40 I'm calling this [[bugs/done]] --[[Joey]]