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
Copy file name to clipboardExpand all lines: docs/source/headers.rst
+17-21Lines changed: 17 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,11 @@ Additional information
81
81
Usage
82
82
^^^^^^^
83
83
84
-
``secureHeaders.framework(response)``
84
+
.. code:: javascript
85
+
86
+
constsecureHeaders=newblockade.SecureHeaders();
87
+
secureHeaders.framework(response);
88
+
85
89
86
90
**Default HTTP response headers:**
87
91
@@ -99,26 +103,18 @@ Usage
99
103
Options
100
104
^^^^^^^^
101
105
102
-
You can toggle the setting of headers with default values by passing an object with ``true`` or ``false`` and override default values by passing a string or policy to the following options:
103
-
104
-
- ``server`` - set the Server header, e.g. ``Server=“Blockade”``
105
-
*(string / bool / Policy, default=False)*
106
-
- ``hsts`` - set the Strict-Transport-Security header *(string / bool /
107
-
Policy, default=True)*
108
-
- ``xfo`` - set the X-Frame-Options header *(string / bool /
109
-
Policy, default=True)*
110
-
- ``xxp`` - set the X-XSS-Protection header *(string / bool /
111
-
Policy, default=True)*
112
-
- ``content`` - set the X-Content-Type-Options header *(string / bool /
113
-
Policy, default=True)*
114
-
- ``csp`` - set the Content-Security-Policy *(string / bool /
115
-
Policy, default=False)* \*
116
-
- ``referrer`` - set the Referrer-Policy header *(string / bool /
117
-
Policy, default=True)*
118
-
- ``cache`` - set the Cache-control and Pragma headers *(string / bool
119
-
/ Policy, default=True)*
120
-
- ``feature`` - set the Feature-Policy header *(SecurePolicies / string
121
-
/ bool / Policy, default=False)*
106
+
You can toggle the setting of headers with default values by passing an object with ``new blockade.Header().default()`` or ``new blockade.Header().notSet()`` and override default values by passing ``new blockade.Header().set("custom")`` or policy to the following options:
107
+
108
+
- ``server`` - set the Server header, e.g. ``new blockade.Server().set("Blockade")``
109
+
- (default= ``default=Server().notSet()`` )
110
+
- ``hsts`` - set the Strict-Transport-Security header - (default= ``HSTS().default()`` )
111
+
- ``xfo`` - set the X-Frame-Options header - (default= ``XFO().default()`` )
112
+
- ``xxp`` - set the X-XSS-Protection header - (default= ``XXP().default()`` )
113
+
- ``content`` - set the X-Content-Type-Options header - (default= ``Content().default()`` )
114
+
- ``csp`` - set the Content-Security-Policy - (default= ``CSP().notSet()`` )
115
+
- ``referrer`` - set the Referrer-Policy header - (default= ``Referrer().default()`` )
116
+
- ``cache`` - set the Cache-control and Pragma headers - (default= ``Cache().default()`` )
117
+
- ``feature`` - set the Feature-Policy header - (default= ``Feature().notSet()`` )
0 commit comments