mirror of https://github.com/aria2/aria2
Return 200 HTTP status code if exception was caught while executing RPC method
Previously, we returned 500 HTTP status code. I think the found in RPC level, not in HTTP protocol, so 500 is not appropriate.pull/454/head
parent
925b5cec07
commit
17e5c98ba6
|
@ -115,6 +115,10 @@ void HttpServerBodyCommand::sendJsonRpcResponse
|
||||||
httpServer_->disableKeepAlive();
|
httpServer_->disableKeepAlive();
|
||||||
int httpCode;
|
int httpCode;
|
||||||
switch(res.code) {
|
switch(res.code) {
|
||||||
|
case 1:
|
||||||
|
// error caught while executing RpcMethod
|
||||||
|
httpCode = 200;
|
||||||
|
break;
|
||||||
case -32600:
|
case -32600:
|
||||||
httpCode = 400;
|
httpCode = 400;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue