ApricotFramework.AspNetCore.Extensions
0.1.0
Prefix Reserved
dotnet add package ApricotFramework.AspNetCore.Extensions --version 0.1.0
NuGet\Install-Package ApricotFramework.AspNetCore.Extensions -Version 0.1.0
<PackageReference Include="ApricotFramework.AspNetCore.Extensions" Version="0.1.0" />
<PackageVersion Include="ApricotFramework.AspNetCore.Extensions" Version="0.1.0" />
<PackageReference Include="ApricotFramework.AspNetCore.Extensions" />
paket add ApricotFramework.AspNetCore.Extensions --version 0.1.0
#r "nuget: ApricotFramework.AspNetCore.Extensions, 0.1.0"
#:package ApricotFramework.AspNetCore.Extensions@0.1.0
#addin nuget:?package=ApricotFramework.AspNetCore.Extensions&version=0.1.0
#tool nuget:?package=ApricotFramework.AspNetCore.Extensions&version=0.1.0
ApricotFramework.AspNetCore.Extensions
General-purpose ASP.NET Core extensions: streaming multipart uploads, query-string-aware routing, and one-line setup for CORS, forwarded headers and cookie policy.
No package dependencies — just a FrameworkReference to Microsoft.AspNetCore.App.
Install
dotnet add package ApricotFramework.AspNetCore.Extensions
Usage
using ApricotFramework.AspNetCore.Extensions.Cors;
using ApricotFramework.AspNetCore.Extensions.Forwarding;
builder.Services.AddAnyOriginCors();
builder.Services.AddForwardingConfiguration();
app.UseForwardedHeaders();
app.UseCors(CorsExtensions.DefaultPolicyName);
Read an upload without buffering it. Each file is handed over as it arrives, so memory use does not grow with the request — 1 GB costs no more than 1 MB:
using ApricotFramework.AspNetCore.Extensions.ModelBinding;
using ApricotFramework.AspNetCore.Extensions.Uploads;
[HttpPost("upload")]
[DisableFormValueModelBinding] // or MVC reads the body first and leaves nothing
public async Task<IActionResult> Upload(CancellationToken cancellationToken)
{
var fields = await this.Request.StreamFilesAsync(
file => blobStore.WriteAsync(file.FileName, file.OpenReadStream(), cancellationToken),
cancellationToken);
return this.Ok(new { Title = fields["title"].ToString() });
}
This library sets no size limit, but Kestrel caps a request body at 30 MB by default and answers
413 above it. Raise it in code — Limits is not read from the Kestrel configuration section, so
setting it in appsettings.json is silently ignored:
builder.WebHost.ConfigureKestrel(o => o.Limits.MaxRequestBodySize = 2048L * 1024 * 1024);
Note that AddForwardingConfiguration trusts X-Forwarded-* from any peer, because a proxy's
address is rarely knowable up front. That is safe only while the application cannot be reached
except through the proxy — anything able to connect directly can otherwise choose its own apparent
IP address, scheme and host. Pass a callback to name the real proxies where the deployment allows
it.
Full documentation: https://projectapricot.dev
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 183 | 8/13/2026 |