Skip to content

Commit ab53ea7

Browse files
committed
Fix path validation and proxy initialization
1 parent e768fd7 commit ab53ea7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Sleet/Util.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ internal static void InitNetwork(LocalSettings settings)
1616
var proxySettings = settings?.Json?["proxy"] ?? new JObject();
1717
if (proxySettings["useDefaultCredentials"]?.ToObject<bool>() == true)
1818
{
19-
WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultCredentials;
19+
if (WebRequest.DefaultWebProxy != null)
20+
{
21+
WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultCredentials;
22+
}
2023
}
2124
}
2225

src/SleetLib/FileSystem/AzureFileSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public AzureFileSystem(LocalCache cache, Uri root, Uri baseUri, BlobServiceClien
2424
var expectedPath = UriUtility.EnsureTrailingSlash(root);
2525

2626
// Verify that the provided path is sane.
27-
if (!expectedPath.AbsoluteUri.StartsWith(expectedPath.AbsoluteUri, StringComparison.Ordinal))
27+
if (!expectedPath.AbsoluteUri.StartsWith(containerUri.AbsoluteUri, StringComparison.Ordinal))
2828
{
2929
throw new ArgumentException($"Invalid feed path. Azure container {container} resolved to {containerUri.AbsoluteUri} which does not match the provided URI of {expectedPath} Update path in sleet.json or remove the path property to auto resolve the value if using a connection string.");
3030
}

0 commit comments

Comments
 (0)