Skip to content

Commit 7b43ba2

Browse files
committed
fix: accept 204 No Content status code in ping method
- Update the ping method to consider 204 No Content as a valid response - This change improves compatibility with services that may return 204 instead of 200
1 parent 5a8dd0d commit 7b43ba2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/src/client.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ class Client {
4848
this.c.options.receiveTimeout = Duration(milliseconds: timeout);
4949

5050
/// Test whether the service can connect
51+
/// Accepts both 200 OK and 204 No Content status codes as valid responses
5152
Future<void> ping([CancelToken? cancelToken]) async {
5253
var resp = await c.wdOptions(this, '/', cancelToken: cancelToken);
53-
if (resp.statusCode != 200) {
54+
if (resp.statusCode != 200 && resp.statusCode != 204) {
5455
throw newResponseError(resp);
5556
}
5657
}

0 commit comments

Comments
 (0)