Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^2: LWP::UserAgent Client-Warning 500 against HTTP standards?

by pryrt (Abbot)
on Sep 30, 2022 at 13:30 UTC ( #11147180=note: print w/replies, xml ) Need Help??

in reply to Re: LWP::UserAgent Client-Warning 500 against HTTP standards?
in thread LWP::UserAgent Client-Warning 500 against HTTP standards?

The 4xx set is for operations where the client is at fault: malformed requests, unauthorized or forbidden access, unsatisfiable negotiation requests and so on.

Playing devil's advocate for a 4xx response: When a client requesting gets a 404 from the server, because the file doesn't exist (so the client made a "mistake" by requesting a resource that doesn't exist); this is true even when the true error is that index.html linked to invalid/file.dne and the only "mistake" the client made was trying to download a resource linked from index.html . Likewise, requesting from a server that doesn't exist is similarly the client's fault for asking for a server that doesn't exist... but in the absence of a server to tell it that the client made a mistake, it wouldn't be unreasonable for the client to admit "User, I made a mistake in trying to access , even though you're the one who asked me to access it". I would even argue for the literal 400 BAD REQUEST response, because it "indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing)." -- where the client error was "asking for a server that doesn't exist (or isn't currently online)"

But similarly, the choice of a 500 error also makes sense: normally, 500 errors are a server's response to an error that it doesn't have better answer for (like "the underlying CGI doesn't know how to generate proper headers" or "doesn't have the proper linux permissions to execute the script"); so when the server is so dissociated that the client cannot see it, I could see the client arbitrarily deciding "this must be a 500, because the server is so confused or messed up that it refuses to respond at all".

But honestly, I think it would be better for LWP::UserAgent to die instead, for reasons given elsewhere in this discussion. That really seems like the best and most natural choice to me.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11147180]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2023-03-24 19:52 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (61 votes). Check out past polls.