Skip to content

Commit

Permalink
Merge pull request #68 from davetimmins/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
davetimmins authored Apr 22, 2020
2 parents 074e1b9 + 3d6143b commit a805ab0
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 95 deletions.
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var solution = "./Anywhere.ArcGIS.sln";

var version = "1.11.0";
var version = "1.11.1";
var versionSuffix = Environment.GetEnvironmentVariable("VERSION_SUFFIX");

//////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 3 additions & 4 deletions src/Anywhere.ArcGIS/Anywhere.ArcGIS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<RepositoryUrl>https://github.com/davetimmins/Anywhere.ArcGIS</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>ArcGIS ArcGISServer ArcGISOnline Esri REST netstandard anywhere GIS Mapping Map Location GeoLocation OAuth</PackageTags>
<Version>1.11.0</Version>
<Version>1.11.1</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>

Expand All @@ -24,18 +24,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LibLog" Version="5.0.2">
<PackageReference Include="LibLog" Version="5.0.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="SourceLink.Create.GitHub" Version="2.8.3" PrivateAssets="All" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.8.3" />
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.8.3" />
<PackageReference Include="dotMorten.OmdGenerator" Version="0.2.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
19 changes: 10 additions & 9 deletions src/Anywhere.ArcGIS/PortalGatewayBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -677,15 +677,7 @@ protected async Task<T> Get<T, TRequest>(TRequest requestObject, CancellationTok

var endpoint = requestObject.Endpoint;
var url = endpoint.BuildAbsoluteUrl(RootUrl) + AsRequestQueryString(Serializer, requestObject);

if (url.Length > MaximumGetRequestLength)
{
_logger.DebugFormat("Url length {0} is greater than maximum configured {1}, switching to POST.", url.Length, MaximumGetRequestLength);
return await Post<T, TRequest>(requestObject, ct).ConfigureAwait(false);
}

requestObject.BeforeRequest?.Invoke();


var token = await CheckGenerateToken(ct).ConfigureAwait(false);
if (ct.IsCancellationRequested)
{
Expand All @@ -700,6 +692,7 @@ protected async Task<T> Get<T, TRequest>(TRequest requestObject, CancellationTok
if (token != null && !string.IsNullOrWhiteSpace(token.Value) && !url.Contains("token="))
{
url += (url.Contains("?") ? "&" : "?") + "token=" + token.Value;
requestObject.Token = token.Value;
_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(token.Value);
if (token.AlwaysUseSsl)
{
Expand All @@ -712,7 +705,15 @@ protected async Task<T> Get<T, TRequest>(TRequest requestObject, CancellationTok
{
throw new HttpRequestException(string.Format("Not a valid url: {0}", url));
}

if (url.Length > MaximumGetRequestLength)
{
_logger.DebugFormat("Url length {0} is greater than maximum configured {1}, switching to POST.", url.Length, MaximumGetRequestLength);
return await Post<T, TRequest>(requestObject, ct).ConfigureAwait(false);
}

_logger.DebugFormat("GET {0}", uri.AbsoluteUri);
requestObject.BeforeRequest?.Invoke();

if (CancelPendingRequests)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="Polly" Version="6.0.1" />
<PackageReference Include="Serilog" Version="2.7.1" />
<PackageReference Include="System.Reactive.Linq" Version="3.1.1" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="Polly" Version="7.2.0" />
<PackageReference Include="Serilog" Version="2.9.0" />
<PackageReference Include="System.Reactive.Linq" Version="4.3.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0" />
</ItemGroup>

Expand Down
Loading

0 comments on commit a805ab0

Please sign in to comment.