-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(WIP) Set up
Content-Security-Policy
"reporting" (monitoring)
- Loading branch information
Showing
3 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
TASVideos/Pages/Diagnostics/UserAgentInterventionReports.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@model UserAgentInterventionReportsModel | ||
@{ | ||
ViewData.SetTitle("User agent intervention reports"); | ||
} | ||
|
||
This is the endpoint for reports automatically submitted by user agents, which can happen for several reasons:<ul> | ||
<li>CSP violations;</li> | ||
<li><code>Permissions-Policy</code> violations;</li> | ||
<li>use of deprecated features;</li> | ||
<li>crashes; or</li> | ||
<li>pther miscellaneous user-agent interventions.</li> | ||
</ul> | ||
(Paraphrased from <a href="https://developer.mozilla.org/en-US/docs/Web/API/Reporting_API">MDN</a>.) | ||
A JSON payload will be POST'd to one of <code>Reporting-Endpoints</code> (should all be pointing at this page) if any of these are encountered by a conformant browser. |
10 changes: 10 additions & 0 deletions
10
TASVideos/Pages/Diagnostics/UserAgentInterventionReports.cshtml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace TASVideos.Pages.Diagnostics; | ||
|
||
[RequirePermission(PermissionTo.SeeDiagnostics)] | ||
public class UserAgentInterventionReportsModel(ILogger<ILogger> logger) : BasePageModel | ||
{ | ||
public void OnPost() | ||
{ | ||
logger.LogInformation("got POST payload maybe?"); | ||
} | ||
} |