✨ Pool support wildcard in accept types
This commit is contained in:
@@ -228,7 +228,26 @@ public abstract class TusService
|
|||||||
);
|
);
|
||||||
rejected = true;
|
rejected = true;
|
||||||
}
|
}
|
||||||
else if (!policy.AcceptTypes.Contains(contentType))
|
else
|
||||||
|
{
|
||||||
|
var foundMatch = false;
|
||||||
|
foreach (var acceptType in policy.AcceptTypes)
|
||||||
|
{
|
||||||
|
if (acceptType.EndsWith("/*", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
var type = acceptType[..^2];
|
||||||
|
if (!contentType.StartsWith($"{type}/", StringComparison.OrdinalIgnoreCase)) continue;
|
||||||
|
foundMatch = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (acceptType.Equals(contentType, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
foundMatch = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!foundMatch)
|
||||||
{
|
{
|
||||||
eventContext.FailRequest(
|
eventContext.FailRequest(
|
||||||
HttpStatusCode.Forbidden,
|
HttpStatusCode.Forbidden,
|
||||||
@@ -237,6 +256,7 @@ public abstract class TusService
|
|||||||
rejected = true;
|
rejected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!rejected && policy.MaxFileSize is not null)
|
if (!rejected && policy.MaxFileSize is not null)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user