Skip to content

Commit c145a12

Browse files
committed
forcing auth
1 parent 2b59d94 commit c145a12

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/src/common/github.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ class GitHub {
222222
}
223223

224224
headers.putIfAbsent("Accept", () => "application/vnd.github.v3+json");
225+
225226
if (auth.isToken) {
226227
headers.putIfAbsent("Authorization", () => "token ${auth.token}");
227228
} else if (auth.isBasic) {
@@ -281,6 +282,14 @@ class GitHub {
281282

282283
headers.putIfAbsent("Accept", () => "application/vnd.github.v3+json");
283284

285+
if (auth.isToken) {
286+
headers.putIfAbsent("Authorization", () => "token ${auth.token}");
287+
} else if (auth.isBasic) {
288+
var userAndPass =
289+
BASE64.encode(UTF8.encode('${auth.username}:${auth.password}'));
290+
headers.putIfAbsent("Authorization", () => "basic ${userAndPass}");
291+
}
292+
284293
var response = await request("POST", path,
285294
headers: headers,
286295
params: params,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy