mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
Remove dangerouslySetInnerHTML in StackTraceMessage component (#4373)
Druid sometimes returns error message that are contained in "<>", as in `<urlopen error [Errno 61] Connection refused>`. Since Superset's approach is often to bubble up messages coming from external library, it's impossible to predict whether it will contain special characters. There are some cases where our error handling does return some html (presto?), but we should manage that upstream. Plus the current setup has security concerns, so let's move away from that.
This commit is contained in:
parent
803738436e
commit
90d9616f2b
@ -26,20 +26,13 @@ class StackTraceMessage extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const msg = (
|
|
||||||
<div>
|
|
||||||
<p
|
|
||||||
dangerouslySetInnerHTML={{ __html: this.props.message }}
|
|
||||||
/>
|
|
||||||
</div>);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`stack-trace-container${this.hasTrace() ? ' has-trace' : ''}`}>
|
<div className={`stack-trace-container${this.hasTrace() ? ' has-trace' : ''}`}>
|
||||||
<Alert
|
<Alert
|
||||||
bsStyle="warning"
|
bsStyle="warning"
|
||||||
onClick={() => this.setState({ showStackTrace: !this.state.showStackTrace })}
|
onClick={() => this.setState({ showStackTrace: !this.state.showStackTrace })}
|
||||||
>
|
>
|
||||||
{msg}
|
{this.props.message}
|
||||||
</Alert>
|
</Alert>
|
||||||
{this.hasTrace() &&
|
{this.hasTrace() &&
|
||||||
<Collapse in={this.state.showStackTrace}>
|
<Collapse in={this.state.showStackTrace}>
|
||||||
|
Loading…
Reference in New Issue
Block a user