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
1d01c035
Commit
1d01c035
authored
Feb 04, 2015
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(cmd/daemon) more compact representation!
exposed the Decider to make configuration nicer @mappum
parent
db644fe1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
cmd/ipfs/daemon.go
cmd/ipfs/daemon.go
+12
-12
No files found.
cmd/ipfs/daemon.go
View file @
1d01c035
...
...
@@ -193,19 +193,19 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
}()
}
blocklist
:=
&
corehttp
.
BlockList
{}
blocklist
.
SetDecider
(
func
(
s
string
)
bool
{
// for now, only allow paths in the WebUI path
for
_
,
webuipath
:=
range
corehttp
.
WebUIPaths
{
if
strings
.
HasPrefix
(
s
,
webuipath
)
{
return
true
}
}
return
false
})
gateway
:=
corehttp
.
NewGateway
(
corehttp
.
GatewayConfig
{
Writable
:
true
,
BlockList
:
blocklist
,
Writable
:
true
,
BlockList
:
&
corehttp
.
BlockList
{
Decider
:
func
(
s
string
)
bool
{
// for now, only allow paths in the WebUI path
for
_
,
webuipath
:=
range
corehttp
.
WebUIPaths
{
if
strings
.
HasPrefix
(
s
,
webuipath
)
{
return
true
}
}
return
false
},
},
})
var
opts
=
[]
corehttp
.
ServeOption
{
corehttp
.
CommandsOption
(
*
req
.
Context
()),
...
...
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