Skip to content

Commit 4688947

Browse files
committed
rpc_proxy: always allow Proxy calls
1 parent 4badba2 commit 4688947

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

rpc_proxy.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,8 @@ func (p *rpcProxy) convertSuperMacaroon(ctx context.Context, macHex string,
607607
// checkSubSystemStarted checks if the subsystem responsible for handling the
608608
// given URI has started.
609609
func (p *rpcProxy) checkSubSystemStarted(requestURI string) error {
610-
// A request to Lit's status server is always allowed.
611-
if isStatusReq(requestURI) {
610+
// A request to Lit's status and proxy services is always allowed.
611+
if isStatusReq(requestURI) || isProxyReq(requestURI) {
612612
return nil
613613
}
614614

@@ -684,3 +684,11 @@ func isStatusReq(uri string) bool {
684684
uri, fmt.Sprintf("/%s", litrpc.Status_ServiceDesc.ServiceName),
685685
)
686686
}
687+
688+
// isProxyReq returns true if the given request is intended for the litrpc.Proxy
689+
// service.
690+
func isProxyReq(uri string) bool {
691+
return strings.HasPrefix(
692+
uri, fmt.Sprintf("/%s", litrpc.Proxy_ServiceDesc.ServiceName),
693+
)
694+
}

0 commit comments

Comments
 (0)