Skip to content

Commit

Permalink
fix(web): open access error page content type
Browse files Browse the repository at this point in the history
  • Loading branch information
Genteure committed Mar 17, 2024
1 parent ec6d3d3 commit c428086
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions BililiveRecorder.Web/OpenAccessWarningMiddleware.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
Expand Down Expand Up @@ -29,7 +28,7 @@ public Task InvokeAsync(HttpContext context)
if (sourceIpNotLan(context) || haveReverseProxyHeaders(context) || haveCustomHostValue(context))
{
context.Response.StatusCode = 412;
var accept = context.Request.Headers[HeaderNames.Accept];
var accept = context.Request.Headers[HeaderNames.Accept].ToString();
if (accept.Contains("text/html"))
{
context.Response.ContentType = "text/html; charset=utf-8";
Expand Down

0 comments on commit c428086

Please sign in to comment.