From 56b06ca80f11a953ee46dd6ce8963fd92423b7f8 Mon Sep 17 00:00:00 2001 From: Ammar Askar Date: Thu, 17 Nov 2016 14:34:14 -0500 Subject: [PATCH] Make validate treat HTTP code 204 as a success. Fixes #54 --- minecraft/authentication.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/minecraft/authentication.py b/minecraft/authentication.py index 816bc73..bb9df63 100644 --- a/minecraft/authentication.py +++ b/minecraft/authentication.py @@ -182,6 +182,10 @@ class AuthenticationToken(object): req = _make_request(AUTH_SERVER, "validate", {"accessToken": self.access_token}) + # Validate returns 204 to indicate success + # http://wiki.vg/Authentication#Response_3 + if req.status_code == 204: + return True if _raise_from_request(req) is None: return True