Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
94c64c57
Commit
94c64c57
authored
Feb 06, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #751 from jbenet/fix-webui-history
corehttp: allow all webui paths we published.
parents
28079bdc
64a4c279
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
cmd/ipfs/daemon.go
cmd/ipfs/daemon.go
+7
-2
core/corehttp/webui.go
core/corehttp/webui.go
+6
-0
No files found.
cmd/ipfs/daemon.go
View file @
94c64c57
...
...
@@ -195,8 +195,13 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
blocklist
:=
&
corehttp
.
BlockList
{}
blocklist
.
SetDecider
(
func
(
s
string
)
bool
{
// only allow paths that begin with the WebUI path
return
strings
.
HasPrefix
(
s
,
corehttp
.
WebUIPath
)
// for now, only allow paths in the WebUI path
for
_
,
webuipath
:=
range
corehttp
.
WebUIPaths
{
if
strings
.
HasPrefix
(
s
,
webuipath
)
{
return
true
}
}
return
false
})
gatewayConfig
:=
corehttp
.
GatewayConfig
{
Writable
:
true
,
...
...
core/corehttp/webui.go
View file @
94c64c57
...
...
@@ -3,4 +3,10 @@ package corehttp
// TODO: move to IPNS
const
WebUIPath
=
"/ipfs/QmSHDxWsMPuJQKWmVA1rB5a3NX2Eme5fPqNb63qwaqiqSp"
// this is a list of all past webUI paths.
var
WebUIPaths
=
[]
string
{
WebUIPath
,
"/ipfs/QmctngrQAt9fjpQUZr7Bx3BsXUcif52eZGTizWhvcShsjz"
,
}
var
WebUIOption
=
RedirectOption
(
"webui"
,
WebUIPath
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment