aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/ContentView
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-07-25 17:12:39 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-07-25 17:12:39 -0700
commite1587b2bc1b425a162af30d6c271bcd392047b02 (patch)
treef034b212938758c10592f3a9548d7051f44d823d /web/src/js/components/ContentView
parent70dbd1b32d13d30e15c03ee91b0fab7bfdf429b3 (diff)
downloadmitmproxy-e1587b2bc1b425a162af30d6c271bcd392047b02.tar.gz
mitmproxy-e1587b2bc1b425a162af30d6c271bcd392047b02.tar.bz2
mitmproxy-e1587b2bc1b425a162af30d6c271bcd392047b02.zip
make empty buttons editable
Diffstat (limited to 'web/src/js/components/ContentView')
-rw-r--r--web/src/js/components/ContentView/ContentLoader.jsx6
-rw-r--r--web/src/js/components/ContentView/ViewSelector.jsx2
2 files changed, 6 insertions, 2 deletions
diff --git a/web/src/js/components/ContentView/ContentLoader.jsx b/web/src/js/components/ContentView/ContentLoader.jsx
index fb022df6..697085a9 100644
--- a/web/src/js/components/ContentView/ContentLoader.jsx
+++ b/web/src/js/components/ContentView/ContentLoader.jsx
@@ -41,6 +41,10 @@ export default View => class extends React.Component {
if (this.state.request) {
this.state.request.abort()
}
+ if(props.message.contentLength === 0 || props.message.contentLength === null){
+ return this.setState({request: undefined, content: ""})
+ }
+
let requestUrl = MessageUtils.getContentURL(props.flow, props.message)
// We use XMLHttpRequest instead of fetch() because fetch() is not (yet) abortable.
@@ -75,7 +79,7 @@ export default View => class extends React.Component {
}
render() {
- return this.state.content ? (
+ return this.state.content !== undefined ? (
<View content={this.state.content} {...this.props}/>
) : (
<div className="text-center">
diff --git a/web/src/js/components/ContentView/ViewSelector.jsx b/web/src/js/components/ContentView/ViewSelector.jsx
index 973d2333..89b36231 100644
--- a/web/src/js/components/ContentView/ViewSelector.jsx
+++ b/web/src/js/components/ContentView/ViewSelector.jsx
@@ -35,7 +35,7 @@ export default function ViewSelector({ message }) {
return (
<div className="view-selector btn-group btn-group-xs">
- <ViewButton name="AutoView">auto: {autoViewName}</ViewButton>
+ <ViewButton name="ViewAuto">auto: {autoViewName}</ViewButton>
{Object.keys(ContentViews).map(name =>
name !== "ViewAuto" &&