File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,16 @@ public static HeaderPolicyCollection AddFrameOptionsSameOrigin(this HeaderPolicy
38
38
/// <param name="uri">The uri of the origin in which the page may be displayed in a frame</param>
39
39
/// <returns>The <see cref="HeaderPolicyCollection"/> for method chaining</returns>
40
40
public static HeaderPolicyCollection AddFrameOptionsSameOrigin ( this HeaderPolicyCollection policies , string uri )
41
+ => policies . AddFrameOptionsAllowFrom ( uri ) ;
42
+
43
+ /// <summary>
44
+ /// Add X-Frame-Options ALLOW-FROM {uri} to all requests, where the uri is provided
45
+ /// The page can only be displayed in a frame on the specified origin.
46
+ /// </summary>
47
+ /// <param name="policies">The collection of policies</param>
48
+ /// <param name="uri">The uri of the origin in which the page may be displayed in a frame</param>
49
+ /// <returns>The <see cref="HeaderPolicyCollection"/> for method chaining</returns>
50
+ public static HeaderPolicyCollection AddFrameOptionsAllowFrom ( this HeaderPolicyCollection policies , string uri )
41
51
{
42
52
return policies . ApplyPolicy ( new XFrameOptionsHeader ( $ "ALLOW-FROM { uri } ") ) ;
43
53
}
Original file line number Diff line number Diff line change @@ -267,6 +267,7 @@ namespace Microsoft.AspNetCore.Builder
267
267
}
268
268
public static class XFrameOptionsHeaderExtensions
269
269
{
270
+ public static Microsoft.AspNetCore.Builder.HeaderPolicyCollection AddFrameOptionsAllowFrom(this Microsoft.AspNetCore.Builder.HeaderPolicyCollection policies, string uri) { }
270
271
public static Microsoft.AspNetCore.Builder.HeaderPolicyCollection AddFrameOptionsDeny(this Microsoft.AspNetCore.Builder.HeaderPolicyCollection policies) { }
271
272
public static Microsoft.AspNetCore.Builder.HeaderPolicyCollection AddFrameOptionsSameOrigin(this Microsoft.AspNetCore.Builder.HeaderPolicyCollection policies) { }
272
273
public static Microsoft.AspNetCore.Builder.HeaderPolicyCollection AddFrameOptionsSameOrigin(this Microsoft.AspNetCore.Builder.HeaderPolicyCollection policies, string uri) { }
You can’t perform that action at this time.
0 commit comments