Skip to content

Commit b5a6c66

Browse files
committed
Correctly set path
1 parent 5f24b5c commit b5a6c66

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/StaticWebAssetsSdk/Tasks/DefineStaticWebAssetEndpoints.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,11 @@ private string GetTestFileLength(StaticWebAsset asset)
276276
private static (string mimeType, string cache) ResolveContentType(StaticWebAsset asset, ContentTypeProvider contentTypeProvider, StaticWebAssetGlobMatcher.MatchContext matchContext, TaskLoggingHelper log)
277277
{
278278
var relativePath = asset.ComputePathWithoutTokens(asset.RelativePath);
279+
#if NET9_0_OR_GREATER
279280
matchContext.SetPathAndReinitialize(relativePath.AsSpan());
281+
#else
282+
matchContext.SetPathAndReinitialize(relativePath);
283+
#endif
280284
var mapping = contentTypeProvider.ResolveContentTypeMapping(matchContext, log);
281285

282286
if (mapping.MimeType != null)

0 commit comments

Comments
 (0)