Skip to content

Commit

Permalink
Merge pull request #475 from WildernessLabs/bug/base-address
Browse files Browse the repository at this point in the history
only set the cloud client base address once
  • Loading branch information
adrianstevens authored Feb 15, 2024
2 parents 75b9330 + bedab0f commit d1c2d14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/v2/Meadow.Cloud.Client/MeadowCloudClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ public async Task<bool> Authenticate(string? host = default, CancellationToken c
return false;
}

_httpClient.BaseAddress = new Uri(host);
if (_httpClient.BaseAddress == null)
{
_httpClient.BaseAddress = new Uri(host);
}

_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

return true;
}
}

0 comments on commit d1c2d14

Please sign in to comment.