@@ -21,6 +21,9 @@ class Http extends \Magento\Framework\HTTP\PhpEnvironment\Response
2121 /** Format for expiration timestamp headers */
2222 const EXPIRATION_TIMESTAMP_FORMAT = 'D, d M Y H:i:s T ' ;
2323
24+ /** X-FRAME-OPTIONS Header name */
25+ const HEADER_X_FRAME_OPT = 'X-Frame-Options ' ;
26+
2427 /** @var \Magento\Framework\Stdlib\CookieManagerInterface */
2528 protected $ cookieManager ;
2629
@@ -51,6 +54,17 @@ public function __construct(
5154 $ this ->dateTime = $ dateTime ;
5255 }
5356
57+ /**
58+ * Sends the X-FRAME-OPTIONS header to protect against click-jacking
59+ *
60+ * @param string $value
61+ * @return void
62+ */
63+ public function setXFrameOptions ($ value )
64+ {
65+ $ this ->setHeader (self ::HEADER_X_FRAME_OPT , $ value );
66+ }
67+
5468 /**
5569 * Send Vary cookie
5670 *
@@ -109,6 +123,7 @@ public function setPrivateHeaders($ttl)
109123 * Set headers for no-cache responses
110124 *
111125 * @return void
126+ * @codeCoverageIgnore
112127 */
113128 public function setNoCacheHeaders ()
114129 {
@@ -122,6 +137,7 @@ public function setNoCacheHeaders()
122137 *
123138 * @param string $content String in JSON format
124139 * @return \Magento\Framework\App\Response\Http
140+ * @codeCoverageIgnore
125141 */
126142 public function representJson ($ content )
127143 {
@@ -131,6 +147,7 @@ public function representJson($content)
131147
132148 /**
133149 * @return string[]
150+ * @codeCoverageIgnore
134151 */
135152 public function __sleep ()
136153 {
@@ -141,6 +158,7 @@ public function __sleep()
141158 * Need to reconstruct dependencies when being de-serialized.
142159 *
143160 * @return void
161+ * @codeCoverageIgnore
144162 */
145163 public function __wakeup ()
146164 {
@@ -154,6 +172,7 @@ public function __wakeup()
154172 *
155173 * @param string $time
156174 * @return string
175+ * @codeCoverageIgnore
157176 */
158177 protected function getExpirationHeader ($ time )
159178 {
0 commit comments