Esempio n. 1
0
        /// <inheritdoc/>
        public async ValueTask <string> GenerateKeyAsync(FilterContext filterContext)
        {
            var keyBuilder = _stringBuilderPool.Get();

            try
            {
                var path = filterContext.HttpContext.Request.Path.Value !;

                if (path.EndsWith('/'))
                {
                    keyBuilder.Append(path, 0, path.Length - 1);
                }
                else
                {
                    keyBuilder.Append(path, 0, path.Length);
                }
                return(await _innerBuilder.BuildAsync(filterContext, keyBuilder));
            }
            finally
            {
                _stringBuilderPool.Return(keyBuilder);
            }
        }