示例#1
0
        internal Task <DateTimeOffset?> GetExpirationIfSupported(string fileId, CancellationToken cancellationToken)
        {
            if (!_isSupported)
            {
                return(Task.FromResult <DateTimeOffset?>(null));
            }

            return(_expirationStore.GetExpirationAsync(fileId, cancellationToken));
        }
示例#2
0
        private async Task ValidateInternal(ContextAdapter context, ITusExpirationStore expirationStore)
        {
            var expires = await expirationStore.GetExpirationAsync(context.Request.FileId, context.CancellationToken);

            if (expires?.HasPassed() == true)
            {
                await NotFound();
            }
        }