-
-
Notifications
You must be signed in to change notification settings - Fork 826
Display warning if widget is mixed content #1263
Conversation
Can one of the admins verify this patch? |
errorMsg: PropTypes.string, | ||
}; | ||
AppWarning.defaultProps = { | ||
errorMsg: _t('Error'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't do _t
here. It has to be in the render
method (or function AppWarning
in this case).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, fair enough ... I should learn some more about the translation stuff.
@@ -207,6 +219,14 @@ export default React.createClass({ | |||
></iframe> | |||
</div> | |||
); | |||
} else if (this.isMixedContent() == true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can drop the == true
and also does this work if hasPermissionToLoad=true
but it's mixed content? 0:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, yes,... fixed.
const parentContentProtocol = window.location.protocol; | ||
const u = url.parse(this.props.url); | ||
const childContentProtocol = u.protocol; | ||
if (parentContentProtocol === 'https:' && childContentProtocol !== parentContentProtocol) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be clearer to say:
if (parentContentProtocol === 'https:' && childContentProtocol !== 'https:') {
// ...
}
IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@kegsay - PTAL |
LGTM |
Need to wait for travis tests though. |
|
Tests still failing. |
const u = url.parse(this.props.url); | ||
const childContentProtocol = u.protocol; | ||
if (parentContentProtocol === 'https:' && childContentProtocol !== 'https:') { | ||
console.warn("Refusing to load mixed-content app:", parentContentProtocol, childContentProtocol, window.location, this.props.url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line needs splitting across multiple for tests to pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting that @t3chguy, sorted now :)
LGTM |
No description provided.