Skip to content

Commit

Permalink
Stop prepending ipv8 endpoints with slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlovsky committed Sep 28, 2021
1 parent 4c7ffe2 commit e20030f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tribler-core/tribler_core/components/ipv8.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async def run(self):

await self.init_endpoints(['statistics'], [('ipv8', ipv8)])
await self.init_ipv8_endpoints(ipv8, [
'/asyncio', '/attestation', '/dht', '/identity', '/isolation', '/network', '/noblockdht', '/overlays'
'asyncio', 'attestation', 'dht', 'identity', 'isolation', 'network', 'noblockdht', 'overlays'
])

def make_bootstrapper(self) -> DispersyBootstrapper:
Expand Down
3 changes: 2 additions & 1 deletion src/tribler-core/tribler_core/components/restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ async def init_ipv8_endpoints(self, ipv8, endpoints):

ipv8_root_endpoint = rest_component.rest_manager.get_endpoint('ipv8')
if ipv8_root_endpoint:
path_set = {'/' + name for name in endpoints}
for path, endpoint in ipv8_root_endpoint.endpoints.items():
if path in endpoints:
if path in path_set:
endpoint.initialize(ipv8)

async def shutdown(self):
Expand Down
2 changes: 1 addition & 1 deletion src/tribler-core/tribler_core/components/tunnels.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def run(self):
self.community = community

await self.init_endpoints(['downloads', 'debug'], [('tunnel_community', community)])
await self.init_ipv8_endpoints(self._ipv8, ['/tunnel'])
await self.init_ipv8_endpoints(self._ipv8, ['tunnel'])

async def shutdown(self):
await super().shutdown()
Expand Down

0 comments on commit e20030f

Please sign in to comment.