diff --git a/ShareX.UploadersLib/TextUploaders/OneTimeSecret.cs b/ShareX.UploadersLib/TextUploaders/OneTimeSecret.cs index a45cb1c78..ddf107d78 100644 --- a/ShareX.UploadersLib/TextUploaders/OneTimeSecret.cs +++ b/ShareX.UploadersLib/TextUploaders/OneTimeSecret.cs @@ -24,6 +24,7 @@ #endregion License Information (GPL v3) using Newtonsoft.Json; +using ShareX.HelpersLib; using System.Collections.Generic; using System.Collections.Specialized; @@ -45,10 +46,7 @@ public override UploadResult UploadText(string text, string fileName) Dictionary args = new Dictionary(); args.Add("secret", text); - NameValueCollection headers = new NameValueCollection(); - headers.Add("Authorization", "Basic " + System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes((API_USERNAME + ":" + API_KEY)))); - - result.Response = SendRequest(HttpMethod.POST, API_ENDPOINT, args, headers); + result.Response = SendRequest(HttpMethod.POST, API_ENDPOINT, args, CreateAuthenticationHeader(API_USERNAME, API_KEY)); if (!string.IsNullOrEmpty(result.Response)) { @@ -56,7 +54,7 @@ public override UploadResult UploadText(string text, string fileName) if (jsonResponse != null) { - result.URL = "https://onetimesecret.com/secret/" + jsonResponse.secret_key; + result.URL = URLHelpers.CombineURL("https://onetimesecret.com/secret/", jsonResponse.secret_key); } } }