This commit is contained in:
parent
0dad6fec71
commit
579f30f591
|
|
@ -46,7 +46,7 @@ namespace Microsoft.AspNetCore.Hosting.StaticWebAssets
|
|||
}
|
||||
else
|
||||
{
|
||||
return InnerProvider.GetDirectoryContents(physicalPath);
|
||||
return InnerProvider.GetDirectoryContents(physicalPath.Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.Hosting.StaticWebAssets
|
|||
}
|
||||
else
|
||||
{
|
||||
return InnerProvider.GetFileInfo(physicalPath);
|
||||
return InnerProvider.GetFileInfo(physicalPath.Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
<Compile Include="$(SharedSourceRoot)EventSource.Testing\TestEventListener.cs" />
|
||||
<Compile Include="$(SharedSourceRoot)EventSource.Testing\TestCounterListener.cs" />
|
||||
<Content Include="testroot\**\*" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
|
||||
<None Remove="testroot\wwwroot\Static Web Assets.txt" />
|
||||
<Content Include="Microsoft.AspNetCore.Hosting.StaticWebAssets.xml" CopyToOutputDirectory="PreserveNewest" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,17 @@ namespace Microsoft.AspNetCore.Hosting.StaticWebAssets
|
|||
Assert.Equal("/_content", provider.BasePath);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void StaticWebAssetsFileProvider_FindsFileWithSpaces()
|
||||
{
|
||||
// Arrange & Act
|
||||
var provider = new StaticWebAssetsFileProvider("/_content",
|
||||
Path.Combine(AppContext.BaseDirectory, "testroot", "wwwroot"));
|
||||
|
||||
// Assert
|
||||
Assert.True(provider.GetFileInfo("/_content/Static Web Assets.txt").Exists);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetFileInfo_DoesNotMatch_IncompletePrefixSegments()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
This file is here to validate that the static web assets file provider respect spaces.
|
||||
Loading…
Reference in New Issue