Skip to content

Commit bc61be5

Browse files
committed
firewall: allow request with no macaroon
1 parent 3f8789f commit bc61be5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

firewall/request_info.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ func NewInfoFromRequest(req *lnrpc.RPCMiddlewareRequest) (*RequestInfo, error) {
7272
ri.MsgID = req.MsgId
7373
ri.RequestID = req.RequestId
7474

75+
// If there is no macaroon in the request, then there is nothing left
76+
// to parse.
77+
if len(req.RawMacaroon) == 0 {
78+
return ri, nil
79+
}
80+
7581
ri.Macaroon = &macaroon.Macaroon{}
7682
if err := ri.Macaroon.UnmarshalBinary(req.RawMacaroon); err != nil {
7783
return nil, fmt.Errorf("error parsing macaroon: %v", err)

0 commit comments

Comments
 (0)