Skip to content

Commit 6977888

Browse files
committed
feat: switch to multiaddr uri syntax
1 parent e281a31 commit 6977888

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

module.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
func init() {
2626
//caddy.RegisterModule(new(LL))
27-
caddy.RegisterNetwork("multiaddr", registerMultiaddrURI)
27+
caddy.RegisterNetwork("multiaddr:", registerMultiaddrURI)
2828
}
2929

3030
func registerMultiaddrURI(ctx context.Context, network, addr string, cfg net.ListenConfig) (any, error) {
@@ -33,7 +33,7 @@ func registerMultiaddrURI(ctx context.Context, network, addr string, cfg net.Lis
3333
return nil, fmt.Errorf("context is not a caddy.Context: %T", ctx)
3434
}
3535

36-
if network != "multiaddr" {
36+
if network != "multiaddr:" {
3737
return nil, fmt.Errorf("multiaddr URI network only handles multiaddr URIs")
3838
}
3939

@@ -48,7 +48,7 @@ func registerMultiaddrURI(ctx context.Context, network, addr string, cfg net.Lis
4848
}
4949
addr = addr[:lastColon]
5050

51-
ma, err := multiaddr.NewMultiaddr(addr)
51+
ma, err := multiaddr.NewMultiaddr("/" + addr)
5252
if err != nil {
5353
return nil, fmt.Errorf("could not parse multiaddr: %w", err)
5454
}

0 commit comments

Comments
 (0)