1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-09 08:56:13 +00:00

Fix for credentials reading from file, adjusted client options base adress to always end on a /

This commit is contained in:
JKorf 2020-10-07 08:31:43 +02:00
parent 133279b28b
commit 48a2c095a4
2 changed files with 14 additions and 2 deletions

View File

@ -80,7 +80,7 @@ namespace CryptoExchange.Net.Authentication
/// <param name="identifierSecret">A key to identify the credentials for the API. For example, when set to `binanceSecret` the json data should contain a value for the property `binanceSecret`. Defaults to 'apiSecret'.</param>
public ApiCredentials(Stream inputStream, string? identifierKey = null, string? identifierSecret = null)
{
using var reader = new StreamReader(inputStream, Encoding.ASCII, false, 512, true);
using var reader = new StreamReader(inputStream, Encoding.UTF8, false, 512, true);
var stringData = reader.ReadToEnd();
var jsonData = stringData.ToJToken();

View File

@ -76,10 +76,22 @@ namespace CryptoExchange.Net.Objects
/// </summary>
public class ClientOptions : BaseOptions
{
private string _baseAddress;
/// <summary>
/// The base address of the client
/// </summary>
public string BaseAddress { get; set; }
public string BaseAddress
{
get => _baseAddress;
set
{
var newValue = value;
if (!newValue.EndsWith("/"))
newValue += "/";
_baseAddress = newValue;
}
}
/// <summary>
/// The api credentials