aboutsummaryrefslogtreecommitdiff
path: root/lib/Plugins.Essentials
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Plugins.Essentials')
-rw-r--r--lib/Plugins.Essentials/src/EventProcessor.cs6
-rw-r--r--lib/Plugins.Essentials/src/Extensions/JsonResponse.cs4
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/Plugins.Essentials/src/EventProcessor.cs b/lib/Plugins.Essentials/src/EventProcessor.cs
index f292068..3ea61c0 100644
--- a/lib/Plugins.Essentials/src/EventProcessor.cs
+++ b/lib/Plugins.Essentials/src/EventProcessor.cs
@@ -569,7 +569,11 @@ namespace VNLib.Plugins.Essentials
public bool FindResourceInRoot(string resourcePath, bool fullyQualified, out string path)
{
//Special case where user's can specify a fullly qualified path (meant to reach a remote file, eg UNC/network share or other disk)
- if (fullyQualified && Path.IsPathRooted(resourcePath) && Path.IsPathFullyQualified(resourcePath) && FileOperations.FileExists(resourcePath))
+ if (fullyQualified
+ && Path.IsPathRooted(resourcePath)
+ && Path.IsPathFullyQualified(resourcePath)
+ && FileOperations.FileExists(resourcePath)
+ )
{
path = resourcePath;
return true;
diff --git a/lib/Plugins.Essentials/src/Extensions/JsonResponse.cs b/lib/Plugins.Essentials/src/Extensions/JsonResponse.cs
index 549d746..b418b6f 100644
--- a/lib/Plugins.Essentials/src/Extensions/JsonResponse.cs
+++ b/lib/Plugins.Essentials/src/Extensions/JsonResponse.cs
@@ -57,8 +57,8 @@ namespace VNLib.Plugins.Essentials.Extensions
//Alloc buffer
_handle = MemoryUtil.Shared.Alloc<byte>(4096, false);
- //Consume handle for stream, but make sure not to dispose the stream
- _asStream = VnMemoryStream.ConsumeHandle(_handle, 0, false);
+ //Create stream around handle and not own it
+ _asStream = VnMemoryStream.FromHandle(_handle, false, 0, false);
//Get memory owner from handle
_memoryOwner = _handle.ToMemoryManager(false);