Automatic CSRF protection based on Fetch Metadata headers
Explores new automatic CSRF protection in ASP.NET Core .NET 11 preview 6 using Fetch Metadata headers, comparing to traditional token-based approaches.
Andrew Lock — Full-stack ASP.NET developer and creator of .NET Escapades, sharing in-depth tutorials and practical insights on ASP.NET Core, C#, and modern .NET development, backed by a PhD and author of ASP.NET Core in Action.
40 articles from this blog
Explores new automatic CSRF protection in ASP.NET Core .NET 11 preview 6 using Fetch Metadata headers, comparing to traditional token-based approaches.
Explains the Fetch Metadata HTTP headers (Sec-Fetch-Site, etc.) and how they help servers understand request context for security.
Explores improvements to reading Process output in .NET 11, including new APIs to avoid deadlocks and enhance child-process management.
Explores closed class hierarchies in .NET 11 preview, showing how to create them and why they improve exhaustiveness checking.
Explores the new StringBuilder.MoveChunks() API in .NET 11 preview, its usage, implementation, and performance benefits for reducing allocations.
Exploring union types in .NET 11 (C# 15) preview, including usage, implementation, and custom types.
Exploring the new .NET 11 Web Worker template for running background tasks in Blazor to prevent UI blocking.
Highlights new Git 2.54 features: easier rebasing with 'git history', config-defined hooks, and repository statistics.
Learn how to reduce byte[] allocations in .NET Framework using ReadOnlySpan<T> for better performance.
Guide on creating custom Docker sandbox templates for AI agents to add tools and dependencies safely.
Guide to safely running AI coding agents in a microVM using Docker Sandbox, enabling dangerous mode without risking system damage.
Exploring the Microsoft.Extensions.Options.Contextual package for dynamically configuring .NET options based on context.
Details the restructuring of the NetEscapades.EnumGenerators source generator package into three packages, aiming for a stable 1.0 release.
A deep dive into using the System.Diagnostics.Metrics source generators in .NET for creating strongly-typed, boilerplate-free telemetry code.
Introduction to creating and monitoring custom metrics in .NET applications using the System.Diagnostics.Metrics APIs and dotnet-counters.
Explains a technique using reflection and dynamic methods to eliminate allocations when using foreach on an IEnumerable<T> in C#.
A review of File Pilot, a fast and feature-rich replacement for Windows File Explorer, covering its benefits, installation, and current limitations.
Updates to NetEscapades.EnumGenerators source generator, adding new APIs and System.Memory support for faster enum operations.
A tutorial on building a basic .NET CLR profiler using the Silhouette library and NativeAOT to log assembly loads.
A developer's first impressions and customization of the Zed editor for .NET and Markdown work, comparing it to VS Code and other IDEs.