mirror of
https://github.com/hackdiaz-dev/free-turn-proxy.git
synced 2026-10-12 09:41:53 +02:00
fix(vkauth): ловим 486 как auth-error для рецикла аллокации
This commit is contained in:
@@ -78,5 +78,6 @@ func IsAuthError(err error) bool {
|
||||
strings.Contains(s, "Unauthorized") ||
|
||||
strings.Contains(s, "authentication") ||
|
||||
strings.Contains(s, "invalid credential") ||
|
||||
strings.Contains(s, "stale nonce")
|
||||
strings.Contains(s, "stale nonce") ||
|
||||
strings.Contains(s, "486")
|
||||
}
|
||||
|
||||
@@ -31,13 +31,14 @@ func TestIsAuthError(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
cases := map[string]bool{
|
||||
"401 Unauthorized": true,
|
||||
"alloc failed: 401": true,
|
||||
"stale nonce": true,
|
||||
"invalid credential": true,
|
||||
"authentication required": true,
|
||||
"connection refused": false,
|
||||
"": false,
|
||||
"401 Unauthorized": true,
|
||||
"alloc failed: 401": true,
|
||||
"stale nonce": true,
|
||||
"invalid credential": true,
|
||||
"authentication required": true,
|
||||
"486: Allocation Quota Reached": true,
|
||||
"connection refused": false,
|
||||
"": false,
|
||||
}
|
||||
for msg, want := range cases {
|
||||
got := IsAuthError(errors.New(msg))
|
||||
|
||||
Reference in New Issue
Block a user