Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<InvariantTimezone>false</InvariantTimezone>
<BlazorWebAssemblyPreserveCollationData>false</BlazorWebAssemblyPreserveCollationData>
<!-- To change InvariantGlobalization's value, Check out Directory.Build.props -->
<HybridGlobalization Condition="'$(InvariantGlobalization)' == 'false'">true</HybridGlobalization>
<BlazorWebAssemblyLoadAllGlobalizationData Condition="'$(InvariantGlobalization)' == 'false'">true</BlazorWebAssemblyLoadAllGlobalizationData>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
<!--/+:msbuild-conditional:noEmit -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public async ValueTask WriteAsync(ProblemDetailsContext context)
return;
}

await httpContext.Response.WriteAsJsonAsync(problemDetail!, jsonSerializerOptions.GetTypeInfo<ProblemDetails>(), cancellationToken: httpContext.RequestAborted);
await httpContext.Response.WriteAsJsonAsync(problemDetail!, jsonSerializerOptions.GetTypeInfo<AppProblemDetails>(), cancellationToken: httpContext.RequestAborted);
}

private void Handle(Exception exception,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//+:cnd:noEmit
//+:cnd:noEmit
using Fido2NetLib;
using Boilerplate.Shared.Dtos.Statistics;

Expand All @@ -12,7 +12,6 @@ namespace Boilerplate.Server.Api.Services;
//#if (captcha == "reCaptcha")
[JsonSerializable(typeof(GoogleRecaptchaVerificationResponse))]
//#endif
[JsonSerializable(typeof(ProblemDetails))]
[JsonSerializable(typeof(AuthenticatorResponse))]
public partial class ServerJsonContext : JsonSerializerContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static void ConfigureMiddlewares(this WebApplication app)
app.UseXfo(options => options.SameOrigin());
}

Configure_401_403_404_Pages(app);
app.Handle40XStatusCodes();

if (env.IsDevelopment())
{
Expand Down Expand Up @@ -178,7 +178,7 @@ public static void ConfigureMiddlewares(this WebApplication app)
/// To mitigate the challenges posed by this situation, our only recourse is to repurpose the 401, 403, and 404 status codes for
/// not-found and not-authorized responses, at the very least.
/// </summary>
private static void Configure_401_403_404_Pages(WebApplication app)
private static void Handle40XStatusCodes(this WebApplication app)
{
app.Use(async (context, next) =>
{
Expand Down Expand Up @@ -218,10 +218,6 @@ private static void Configure_401_403_404_Pages(WebApplication app)
{
httpContext.Response.Redirect($"{PageUrls.NotFound}?url={httpContext.Request.GetEncodedPathAndQuery()}");
}
else
{
await statusCodeContext.Next.Invoke(statusCodeContext.HttpContext);
}
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ public static async Task Main(string[] args)
var builder = WebApplication.CreateBuilder(options: new()
{
Args = args,
//#if (api == "Integrated")
ContentRootPath = AppContext.BaseDirectory
//#endif
});

AppEnvironment.Set(builder.Environment.EnvironmentName);
Expand Down
Loading