Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
fix GithubUpdater
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaillon committed Nov 11, 2018
1 parent 7e4bc42 commit 4248270
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 3PA/Lib/UpdateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ protected GitHubUpdater Updater {
_gitHubUpdater = new GitHubUpdater {
AssetDownloadFolder = Path.Combine(Config.FolderTemp, "downloads"),
BasicAuthenticationToken = null,
OAuth2Token = Config.GitHubToken,
OAuth2Token = Encoding.ASCII.GetString(Convert.FromBase64String(Config.GitHubToken)),
UserAgent = Config.GitHubUserAgent,
Proxy = Config.Instance.GetWebClientProxy()
};
Expand Down
3 changes: 2 additions & 1 deletion 3PA/Lib/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using System;
using System.IO;
using System.Net;
using System.Text;
using _3PA.MainFeatures;

namespace _3PA.Lib {
Expand Down Expand Up @@ -109,7 +110,7 @@ public static bool SendComment(string message, string url) {
wb.OnInitHttpWebRequest += request => {
request.Proxy = Config.Instance.GetWebClientProxy();
request.UserAgent = "3pUser";
request.Headers.Add("Authorization", "Token " + Config.GitHubToken);
request.Headers.Add("Authorization", "Token " + Encoding.ASCII.GetString(Convert.FromBase64String(Config.GitHubToken)));
};
wb.AddToReq("body", message);
wb.OnRequestEnded += json => { UserCommunication.Notify((json.ResponseException != null ? json.ResponseException.ToString() : "") + "\r\n" + json.StatusCodeResponse + ":" + (json.StatusDescriptionResponse ?? "") + "\r\n" + (json.JsonResponse ?? "")); };
Expand Down
2 changes: 1 addition & 1 deletion 3PA/MainFeatures/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ public static string GitHubUserAgent {
}

public static string GitHubToken {
get { return @"ae864fa362637283d43a341de349a5a212a2a1cc"; }
get { return @"MmViMDJlNWVlYWZlMTIzNGIxN2VmOTkxMGQ1NzljMTRkM2E1ZDEyMw=="; }
}

public static int UpdateCheckEveryXMin = 12 * 60;
Expand Down

0 comments on commit 4248270

Please sign in to comment.