Skip to content

Commit

Permalink
com.utilities.rest 2.3.0 (#52)
Browse files Browse the repository at this point in the history
- Added IClient.EnableDebug for easier enabling of http response logging
- com.utilities.extensions -> 1.1.13
- DiskDownload cache file writing returns to main thread
- updated upm subtree workflow
  • Loading branch information
StephenHodgson authored Nov 28, 2023
1 parent 032ec7e commit d29d316
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/upm-subtree-split.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
upm-subtree-split:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: upm subtree split
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,8 @@ protected BaseClient(TAuthentication authentication, TSettings settings)
/// The <see cref="TSettings"/> for this <see cref="IClient"/>.
/// </summary>
public TSettings Settings { get; }

/// <inheritdoc />
public bool EnableDebug { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ protected string GetUrl(string endpoint = "", Dictionary<string, string> queryPa
return result;
}

private bool enableDebug;

/// <summary>
/// Enables or disables the logging of all http responses of header and body information for this endpoint.<br/>
/// WARNING! Enabling this in your production build, could potentially leak sensitive information!
/// </summary>
public bool EnableDebug { get; set; }
public bool EnableDebug
{
get => enableDebug || client.EnableDebug;
set => enableDebug = value;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public async Task WriteCacheItemAsync(byte[] data, string cachePath, Cancellatio

try
{
await File.WriteAllBytesAsync(cachePath, data, cancellationToken);
await File.WriteAllBytesAsync(cachePath, data, cancellationToken).ConfigureAwait(true);
}
catch (Exception e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@ namespace Utilities.WebRequestRest.Interfaces
{
public interface IClient
{
/// <summary>
/// Enables or disables the logging of all http responses of header and body information for this endpoint.<br/>
/// WARNING! Enabling this in your production build, could potentially leak sensitive information!
/// </summary>
bool EnableDebug { get; set; }
}
}
4 changes: 2 additions & 2 deletions Utilities.Rest/Packages/com.utilities.rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Utilities.Rest",
"description": "This package contains useful RESTful utilities for the Unity Game Engine.",
"keywords": [],
"version": "2.2.5",
"version": "2.2.6",
"unity": "2021.3",
"documentationUrl": "https://github.com/RageAgainstThePixel/com.utilities.rest#documentation",
"changelogUrl": "https://github.com/RageAgainstThePixel/com.utilities.rest/releases",
Expand All @@ -16,7 +16,7 @@
"url": "https://github.com/StephenHodgson",
"dependencies": {
"com.utilities.async": "2.1.1",
"com.utilities.extensions": "1.1.12",
"com.utilities.extensions": "1.1.13",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
Expand Down

0 comments on commit d29d316

Please sign in to comment.