[ee122] error checking
Daniel Killebrew
dank at eecs.berkeley.edu
Wed Oct 24 16:06:18 PDT 2007
Nescio Nomen wrote:
> So the client sends a get request to the server, the server sends a
> response back. Do we have to verify that the response makes perfect
> sense, eg their HTTP version matches our own,
You can check that the HTTP version is 1.0 or 1.1. If it's not then it's
fine with me if you classify it as a bad response.
> the status code matches the phrase (eg 200 = OK)?
You should check the code, the phrase is more for us humans.
> The specs don't say to do any error checking on the response so if
> it's not a big deal I'd just rather parse it as if it's correct and
> focus on more important things. If the response is nonsense, it'll
> probably be detectable most of the time anyway, eg a regexp will
> probably not find the status number, and so you can just reject the
> response.
If you choose to keep parsing a response even if the HTTP version does
not match 1.1 or 1.0, and you are able to parse the response and do
something useful, that's also good.
Daniel
> If we do have to do the kind of error checking I mentioned earlier,
> should it be classified as a parsing error?
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ee122 mailing list
> ee122 at mailman.ICSI.Berkeley.EDU
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/ee122
>
More information about the ee122
mailing list