Skip to content

Commit

Permalink
Add global config security options to meta tag helper
Browse files Browse the repository at this point in the history
  • Loading branch information
seangwright committed Dec 5, 2023
1 parent d41c75b commit 2cd1f8d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Htmx.TagHelpers/HtmxConfigMetaTagHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ public class HtmxConfigMetaTagHelper : TagHelper
[HtmlAttributeName("addedClass")]
public string? AddedClass { get; set; }

/// <summary>
/// defaults to false
/// </summary>
[HtmlAttributeName("selfRequestsOnly")]
public bool SelfRequestsOnly { get; set; }

/// <summary>
/// defaults to true
/// </summary>
[HtmlAttributeName("allowScriptTags")]
public bool AllowScriptTags { get; set; } = true;

/// <summary>
/// defaults to true
/// </summary>
Expand Down Expand Up @@ -187,6 +199,8 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
var config = JsonSerializer.Serialize(new
{
AllowEval,
SelfRequestsOnly,
AllowScriptTags,
DisableSelector,
HistoryEnabled,
IndicatorClass,
Expand Down

0 comments on commit 2cd1f8d

Please sign in to comment.