internal Task <DateTimeOffset?> GetExpirationIfSupported(string fileId, CancellationToken cancellationToken) { if (!_isSupported) { return(Task.FromResult <DateTimeOffset?>(null)); } return(_expirationStore.GetExpirationAsync(fileId, cancellationToken)); }
private async Task ValidateInternal(ContextAdapter context, ITusExpirationStore expirationStore) { var expires = await expirationStore.GetExpirationAsync(context.Request.FileId, context.CancellationToken); if (expires?.HasPassed() == true) { await NotFound(); } }