Skip to content

Commit

Permalink
Revert "Merge pull request elastic#7568 from bevacqua/hotfix/config-xss"
Browse files Browse the repository at this point in the history
This reverts commit 1785ccf [formerly 271aa69], reversing
changes made to 7903281 [formerly 1248b2f].

This should not have been merged because tests did not pass.


Former-commit-id: dda84e9
  • Loading branch information
epixa committed Jun 28, 2016
1 parent 1785ccf commit b6ff2a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/ui/public/metadata.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import $ from 'jquery';
import _ from 'lodash';
// singleton for immutable copy of window.__KBN__

const state = $('kbn-initial-state').attr('data');
const kbn = window.__KBN__ = JSON.parse(state);
if (!_.has(window, '__KBN__')) {
throw new Error('window.__KBN__ must be set for metadata');
}

const kbn = _.cloneDeep(window.__KBN__ || {});
export default deepFreeze(kbn);

function deepFreeze(object) {
Expand Down
6 changes: 3 additions & 3 deletions src/ui/views/chrome.jade
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-
var appName = 'kibana';
- var j = function (o) { return JSON.stringify(o); }
- var appName = 'kibana';

block vars

Expand All @@ -12,5 +12,5 @@ html(lang='en')
title Kibana
block head
body(kbn-chrome, id='#{appName}-body')
kbn-initial-state(data=JSON.stringify(kibanaPayload))
script window.__KBN__ = !{j(kibanaPayload)};
block content

0 comments on commit b6ff2a6

Please sign in to comment.