mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-07-25 18:57:07 +00:00
Fix for credentials reading from file, adjusted client options base adress to always end on a /
This commit is contained in:
parent
133279b28b
commit
48a2c095a4
@ -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>
|
/// <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)
|
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 stringData = reader.ReadToEnd();
|
||||||
var jsonData = stringData.ToJToken();
|
var jsonData = stringData.ToJToken();
|
||||||
|
@ -76,10 +76,22 @@ namespace CryptoExchange.Net.Objects
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class ClientOptions : BaseOptions
|
public class ClientOptions : BaseOptions
|
||||||
{
|
{
|
||||||
|
private string _baseAddress;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The base address of the client
|
/// The base address of the client
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BaseAddress { get; set; }
|
public string BaseAddress
|
||||||
|
{
|
||||||
|
get => _baseAddress;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
var newValue = value;
|
||||||
|
if (!newValue.EndsWith("/"))
|
||||||
|
newValue += "/";
|
||||||
|
_baseAddress = newValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The api credentials
|
/// The api credentials
|
||||||
|
Loading…
x
Reference in New Issue
Block a user