Check HTTP status codes in RawClient.Delete()#391
Conversation
bobbyhouse
left a comment
There was a problem hiding this comment.
praise: Nice job going the extra mile to address issue at the gateway
suggestion (non-blocking): Consider adding unit tests. None exist currently. If you add tests it would set an expectation going forward.
question (non-blocking): Does the same bug exist for Post()? Do you know if there are any downstream problems we'll have if the same behavior exists there as well?
|
Only one caller passes nil for result, |
3e2c3d4 to
e965a5f
Compare
What I did
RawClient.Delete(), consistent withGet()andPost()which already check for non-2xx responsesRawClient.Delete()inpkg/desktop/raw_client.godiscards the response body and only returns IO errors. UnlikeGet()andPost(), it never inspects the HTTP status code. This means any error returned by the Docker Desktop backend (404, 500, etc.) is silently swallowed.Testing
docker mcp oauth revoke <app>against an improperly configured OAuth app, it surfaced errordocker mcp oauth revoke <app>against a working server and it succeededmake test. All passed(showing as 0.00 seconds since used a previously cached run of the test)
Related issue
(not mandatory) A picture of a cute animal, if possible in relation to what you did