Implemented a workaround for certain devices dropping connection after digest authentication challege in connection requests.

This commit is contained in:
Zaid Abdulla committed 2015-05-29 14:11:05 +03:00
1 parent 305558f186
commit 74008bc7de
1 file changed
+3
+3
View File
@@ -117,6 +117,9 @@ connectionRequest = (deviceId, callback) ->
authString = auth.digest(username, password, uri.path, 'GET', null, authHeader) authString = auth.digest(username, password, uri.path, 'GET', null, authHeader)
conReq(connectionRequestUrl, authString, (statusCode, authHeader) -> conReq(connectionRequestUrl, authString, (statusCode, authHeader) ->
if statusCode == 0
# Workaround for some devices unexpectedly closing the connection
return conReq(connectionRequestUrl, authString, (statusCode) -> callback(statusToError(statusCode)))
callback(statusToError(statusCode)) callback(statusToError(statusCode))
) )
else else