aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api/admin.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-08-14 07:25:33 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-08-14 07:25:33 +0800
commit28b14d3e6d43cb27019e21d0a93a80e7bee1de8c (patch)
tree9995026e87221a80cb5171364ffa734459c16b16 /rpc/api/admin.go
parent73c4e6005c3e47342a4631955ca6fd2782925886 (diff)
parentf9cbd16f27e393d4937354ee31435e0a2f689484 (diff)
downloaddexon-28b14d3e6d43cb27019e21d0a93a80e7bee1de8c.tar
dexon-28b14d3e6d43cb27019e21d0a93a80e7bee1de8c.tar.gz
dexon-28b14d3e6d43cb27019e21d0a93a80e7bee1de8c.tar.bz2
dexon-28b14d3e6d43cb27019e21d0a93a80e7bee1de8c.tar.lz
dexon-28b14d3e6d43cb27019e21d0a93a80e7bee1de8c.tar.xz
dexon-28b14d3e6d43cb27019e21d0a93a80e7bee1de8c.tar.zst
dexon-28b14d3e6d43cb27019e21d0a93a80e7bee1de8c.zip
Merge pull request #1635 from bas-vk/useragent
support for user agents
Diffstat (limited to 'rpc/api/admin.go')
-rw-r--r--rpc/api/admin.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/rpc/api/admin.go b/rpc/api/admin.go
index 29f342ab6..5e392ae32 100644
--- a/rpc/api/admin.go
+++ b/rpc/api/admin.go
@@ -37,6 +37,7 @@ import (
"github.com/ethereum/go-ethereum/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/comms"
"github.com/ethereum/go-ethereum/rpc/shared"
+ "github.com/ethereum/go-ethereum/rpc/useragent"
"github.com/ethereum/go-ethereum/xeth"
)
@@ -71,6 +72,7 @@ var (
"admin_httpGet": (*adminApi).HttpGet,
"admin_sleepBlocks": (*adminApi).SleepBlocks,
"admin_sleep": (*adminApi).Sleep,
+ "admin_enableUserAgent": (*adminApi).EnableUserAgent,
}
)
@@ -474,3 +476,10 @@ func (self *adminApi) HttpGet(req *shared.Request) (interface{}, error) {
return string(resp), nil
}
+
+func (self *adminApi) EnableUserAgent(req *shared.Request) (interface{}, error) {
+ if fe, ok := self.xeth.Frontend().(*useragent.RemoteFrontend); ok {
+ fe.Enable()
+ }
+ return true, nil
+}