From ce78207546a860cd7f7b93efddbdbba56dcd5bea Mon Sep 17 00:00:00 2001 From: Mithgol the Webmaster Date: Sun, 24 Jan 2016 16:51:58 +0300 Subject: [PATCH 1/3] =?UTF-8?q?use=20a=C2=A0regex=20(based=C2=A0on=C2=A0th?= =?UTF-8?q?e=C2=A0current=20multihash)=20to=C2=A0detect=20a=C2=A0gateway?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/components/navbar.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/components/navbar.jsx b/webapp/components/navbar.jsx index b0e1e2a..a803930 100644 --- a/webapp/components/navbar.jsx +++ b/webapp/components/navbar.jsx @@ -11,7 +11,9 @@ var Updater = React.createClass({ }, checkForUpdates () { var v = window.location.pathname - var gateway = window.location.pathname.indexOf('/ipfs/') === 0 || window.location.pathname.indexOf('/ipns/') === 0 + var gateway = /^\/ip[fn]s\/Qm[1-9A-HJ-NP-Za-km-z]{44}/.test( + window.location.pathname + ) if (v !== '/ipns/boards.ydns.eu/' || !gateway) { this.setState({ update: true }) } From 7a56bad7810e20fecaab2ce649d904db948f881d Mon Sep 17 00:00:00 2001 From: Mithgol the Webmaster Date: Sun, 24 Jan 2016 21:37:08 +0300 Subject: [PATCH 2/3] =?UTF-8?q?a=20domain=20name=20(at=C2=A0least=C2=A0two?= =?UTF-8?q?=20dot-separated=20parts)=20might=C2=A0also=C2=A0appear?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/components/navbar.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/components/navbar.jsx b/webapp/components/navbar.jsx index a803930..de840c7 100644 --- a/webapp/components/navbar.jsx +++ b/webapp/components/navbar.jsx @@ -11,7 +11,7 @@ var Updater = React.createClass({ }, checkForUpdates () { var v = window.location.pathname - var gateway = /^\/ip[fn]s\/Qm[1-9A-HJ-NP-Za-km-z]{44}/.test( + var gateway = /^\/ip[fn]s\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[^.]+\.[^.]+)/.test( window.location.pathname ) if (v !== '/ipns/boards.ydns.eu/' || !gateway) { From 0205d7e6b6ca1971ec516052e9c750fadf7444a6 Mon Sep 17 00:00:00 2001 From: Mithgol the Webmaster Date: Sun, 24 Jan 2016 21:41:42 +0300 Subject: [PATCH 3/3] =?UTF-8?q?correction:=20a=C2=A0domain=C2=A0name=20sho?= =?UTF-8?q?uld=C2=A0only=20be=C2=A0expected=20after=20`/ipns/`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/components/navbar.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webapp/components/navbar.jsx b/webapp/components/navbar.jsx index de840c7..0e1afdb 100644 --- a/webapp/components/navbar.jsx +++ b/webapp/components/navbar.jsx @@ -11,9 +11,11 @@ var Updater = React.createClass({ }, checkForUpdates () { var v = window.location.pathname - var gateway = /^\/ip[fn]s\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[^.]+\.[^.]+)/.test( + var gateway = /^\/ipns\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[^.]+\.[^.]+)/.test( window.location.pathname - ) + ) || /^\/ipfs\/Qm[1-9A-HJ-NP-Za-km-z]{44}/.test( + window.location.pathname + ); if (v !== '/ipns/boards.ydns.eu/' || !gateway) { this.setState({ update: true }) }