[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: well-formedness error





On 19 Jun 2004, at 11:38, Asbjørn Ulsberg wrote:


On Thu, 17 Jun 2004 10:16:14 +0200, Danny Ayers <danny666@xxxxxxxxxxx> wrote:


Perhaps, but the rules themselves shouldn't be lenient.

Absolutely. What I think may be something we can reach consensus on is:


  - Ill-formed XML should not be silently parsed by aggregators.
    PaceServiceError[1] should be an important part of the spec.
+1 On this solution.

Could one not generalize and create an ERROR header in addition to GET, POST, etc
that one could propose to whichever standards body deals with this?


It would not do anything (perhaps send an acknowledgment back or something), and just
log the ERROR in the log file. This looks like a solution to solve this problem for everybody. This seems like a very simple addition to HTTP, and it will probably work anyway, because my bet it that all web servers will log bad requests anyway.



It kind of works already. Here is what I did


hjs@bblfish:0$ telnet localhost 80
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
ERROR /index.html HTTP/1.1
Host: bblfish.localhost
Message: invalid XML

HTTP/1.1 501 Method Not Implemented
Date: Sat, 19 Jun 2004 10:10:37 GMT
Server: Apache/1.3.29 (Darwin)
Vary: accept-language,accept-charset
Allow: GET, HEAD, OPTIONS, TRACE
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1

14c
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>501 Method Not Implemented</TITLE>
</HEAD><BODY>
<H1>Method Not Implemented</H1>
ERROR to /index.html not supported.<P>
Invalid method in request ERROR /index.html HTTP/1.1<P>
<HR>
<ADDRESS>Apache/1.3.29 Server at bblfish.local Port 80</ADDRESS>
</BODY></HTML>

0

Connection closed by foreign host.

And this is what I got in my error log
[Sat Jun 19 12:10:45 2004] [error] [client 127.0.0.1] Invalid method in request ERROR /index.html HTTP/1.1


So it does not log the message which would be useful. But it nearly does the right thing.


- Atom served with wrong HTTP headers MAY be excusable.

I think allowing ill-formed XML spreading around is much, much worse than allowing for some bad HTTP headers now and then. The headers at least don't force one to use regex and other evil methods to parse XML. Everything contained in the XML document should be well-formed according to XML specs. XML over HTTP is another ballgame, but Atom should still state how things should be done -- in a non-lenient way.

____
[1] <url: http://www.intertwingly.net/wiki/pie/PaceServiceError>

--
Asbjørn Ulsberg         -=|=-        asbjornu@xxxxxxxxxxx
«He's a loathsome offensive brute, yet I can't look away»