You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//! This might be a good starting point for most users, but it is highly recommended to spend some time with the documentation for each header, and adjust them to your needs.
43
+
//!
44
+
//! # Configuration
45
+
//!
46
+
//! By default if you construct a new instance of `Helmet` it will not set any headers.
47
+
//!
48
+
//! It is possible to configure `Helmet` to set only the headers you want, by using the `add` method to add headers.
49
+
//!
50
+
//! ```rust
51
+
//! use ntex_helmet::{Helmet, ContentSecurityPolicy, CrossOriginOpenerPolicy};
@@ -863,15 +931,15 @@ impl Header for XPoweredBy {
863
931
///
864
932
/// # Directives
865
933
///
866
-
/// - child-src: Defines valid sources for web workers and nested browsing contexts loaded using elements such as <frame> and <iframe>.
934
+
/// - child-src: Defines valid sources for web workers and nested browsing contexts loaded using elements such as `<frame>` and `<iframe>`.
867
935
/// - connect-src: Applies to XMLHttpRequest (AJAX), WebSocket or EventSource. If not allowed the browser emulates a 400 HTTP status code.
868
936
/// - default-src: The default-src is the default policy for loading content such as JavaScript, Images, CSS, Font's, AJAX requests, Frames, HTML5 Media. See the list of directives to see which values are allowed as default.
869
937
/// - font-src: Defines valid sources for fonts loaded using @font-face.
870
-
/// - frame-src: Defines valid sources for nested browsing contexts loading using elements such as <frame> and <iframe>.
938
+
/// - frame-src: Defines valid sources for nested browsing contexts loading using elements such as `<frame>` and `<iframe>`.
871
939
/// - img-src: Defines valid sources of images and favicons.
872
940
/// - manifest-src: Specifies which manifest can be applied to the resource.
873
-
/// - media-src: Defines valid sources for loading media using the <audio> and <video> elements.
874
-
/// - object-src: Defines valid sources for the <object>, <embed>, and <applet> elements.
941
+
/// - media-src: Defines valid sources for loading media using the `<audio>` and `<video>` elements.
942
+
/// - object-src: Defines valid sources for the `<object>`, `<embed>`, and `<applet>` elements.
875
943
/// - prefetch-src: Specifies which referrer to use when fetching the resource.
876
944
/// - script-src: Defines valid sources for JavaScript.
/// - worker-src: Defines valid sources for Worker, SharedWorker, or ServiceWorker scripts.
883
-
/// - base-uri: Restricts the URLs which can be used in a document's <base> element.
951
+
/// - base-uri: Restricts the URLs which can be used in a document's `<base>` element.
884
952
/// - sandbox: Enables a sandbox for the requested resource similar to the iframe sandbox attribute. The sandbox applies a same origin policy, prevents popups, plugins and script execution is blocked. You can keep the sandbox value empty to keep all restrictions in place, or add values: allow-forms allow-same-origin allow-scripts allow-popups, allow-modals, allow-orientation-lock, allow-pointer-lock, allow-presentation, allow-popups-to-escape-sandbox, allow-top-navigation, allow-top-navigation-by-user-activation.
885
953
/// - form-action: Restricts the URLs which can be used as the target of a form submissions from a given context.
886
-
/// - frame-ancestors: Specifies valid parents that may embed a page using <frame>, <iframe>, <object>, <embed>, or <applet>.
954
+
/// - frame-ancestors: Specifies valid parents that may embed a page using `<frame>`, `<iframe>`, `<object>`, `<embed>`, or `<applet>`.
887
955
/// - report-to: Enables reporting of violations.
888
956
/// - require-trusted-types-for: Specifies which trusted types are required by a resource.
889
957
/// - trusted-types: Specifies which trusted types are defined by a resource.
/// Defines valid sources for Worker, SharedWorker, or ServiceWorker scripts.
938
1006
WorkerSrc(Vec<&'astr>),
939
1007
// Document directives
940
-
/// Restricts the URLs which can be used in a document's <base> element.
1008
+
/// Restricts the URLs which can be used in a document's `<base>` element.
941
1009
BaseUri(Vec<&'astr>),
942
1010
/// Enables a sandbox for the requested resource similar to the iframe sandbox attribute. The sandbox applies a same origin policy, prevents popups, plugins and script execution is blocked. You can keep the sandbox value empty to keep all restrictions in place, or add values: allow-forms allow-same-origin allow-scripts allow-popups, allow-modals, allow-orientation-lock, allow-pointer-lock, allow-presentation, allow-popups-to-escape-sandbox, allow-top-navigation, allow-top-navigation-by-user-activation.
943
1011
Sandbox(Vec<&'astr>),
944
1012
// Navigation directives
945
1013
/// Restricts the URLs which can be used as the target of a form submissions from a given context.
946
1014
FormAction(Vec<&'astr>),
947
-
/// Specifies valid parents that may embed a page using <frame>, <iframe>, <object>, <embed>, or <applet>.
1015
+
/// Specifies valid parents that may embed a page using `<frame>`, `<iframe>`, `<object>`, `<embed>`, or `<applet>`.
0 commit comments