Commit 94c64c57 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

Merge pull request #751 from jbenet/fix-webui-history

corehttp: allow all webui paths we published.
parents 28079bdc 64a4c279
......@@ -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,
......
......@@ -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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment