Closed
Description
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace WebApplication254
{
public class Startup
{
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.Run(context =>
{
var cookie = context.Request.Cookies[".AspNetCore.Cookies"];
return context.Response.WriteAsync($"Hello World {cookie}");
});
}
}
}
Most of these allocations look unnecessary. In the end, we need a collection that has cookies split into name value pairs.