kio_http, HTTP status codes, KIO errors, and kdav
In kio_http we translate staus codes/errors we get from HTTP to KIO error codes. Sometimes they match conceptually, but often there is no natural mapping here. In addition we also expose the raw HTTP status code via metadata.
An issue with this can be seen in the kdav autotests. davcollectionsmultifetchjobtest makes a call to a non-existant URL (triggering a HTTP 404).
In KF5 this gives ERR_DOES_NOT_EXIST, without setting the responsecode
metadata. See https://invent.kde.org/frameworks/kio/-/blob/kf5/src/kioworkers/http/http.cpp?ref_type=heads#L4453
In KF6 this currently gives no KIO error, but sets the responsecode
metadata. Arguably it should set some kind of error, but sending the responsecode seems reasonable.
kdav now trips over the present response code in https://invent.kde.org/frameworks/kdav/-/blob/master/src/common/davcollectionsfetchjob.cpp#L94 and does a doCollectionsFetch
, which causes the test to hang. Removing the if (davJob->latestResponseCode())
makes the test pass.
The question now is: Should we try to make KIO behave as it did in KF5, even if that behavior is arguably weird, or should we accept the behavior change and adapt kdav?