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
3838 /// <param name="uri">The uri of the origin in which the page may be displayed in a frame</param>
3939 /// <returns>The <see cref="HeaderPolicyCollection"/> for method chaining</returns>
4040 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 )
4151 {
4252 return policies . ApplyPolicy ( new XFrameOptionsHeader ( $ "ALLOW-FROM { uri } ") ) ;
4353 }
Original file line number Diff line number Diff line change @@ -267,6 +267,7 @@ namespace Microsoft.AspNetCore.Builder
267267 }
268268 public static class XFrameOptionsHeaderExtensions
269269 {
270+ public static Microsoft.AspNetCore.Builder.HeaderPolicyCollection AddFrameOptionsAllowFrom(this Microsoft.AspNetCore.Builder.HeaderPolicyCollection policies, string uri) { }
270271 public static Microsoft.AspNetCore.Builder.HeaderPolicyCollection AddFrameOptionsDeny(this Microsoft.AspNetCore.Builder.HeaderPolicyCollection policies) { }
271272 public static Microsoft.AspNetCore.Builder.HeaderPolicyCollection AddFrameOptionsSameOrigin(this Microsoft.AspNetCore.Builder.HeaderPolicyCollection policies) { }
272273 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