File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,7 @@ class GitHub {
222
222
}
223
223
224
224
headers.putIfAbsent ("Accept" , () => "application/vnd.github.v3+json" );
225
+
225
226
if (auth.isToken) {
226
227
headers.putIfAbsent ("Authorization" , () => "token ${auth .token }" );
227
228
} else if (auth.isBasic) {
@@ -281,6 +282,14 @@ class GitHub {
281
282
282
283
headers.putIfAbsent ("Accept" , () => "application/vnd.github.v3+json" );
283
284
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
+
284
293
var response = await request ("POST" , path,
285
294
headers: headers,
286
295
params: params,
You can’t perform that action at this time.
0 commit comments