title: How to set X-Frame-Options header in angularjs?
body: <p>I'm getting an OWASP ZAP Scanning alert:</p>
  
  <pre><code>Medium (Medium)    X-Frame-Options Header Not Set
  Description        X-Frame-Options header is not included in the HTTP response to protect against 'ClickJacking' attacks.
  URL                https://10.11.12.13/web/network/config.html
  Method             GET
  Parameter          X-Frame-Options
  </code></pre>
  
  <p>To fix the alert I <a href="https://docs.angularjs.org/api/ng/service/$http#setting-http-headers" rel="nofollow noreferrer">set HTTP headers</a> in <em>app.js</em></p>
  
  <pre><code>$httpProvider.defaults.headers.get['X-Frame-Options'] = 'DENY';
  </code></pre>
  
  <p>When building a project I get a TypeError</p>
  
  <pre><code>[INFO]  TypeError: 'undefined' is not an object (evaluating '$httpProvider.defaults.headers.get['X-Frame-Options']='DENY'')
  </code></pre>
  
  <p>Am I doing something wrong? Or is there a different way of fixing the alert?</p>