lnd: Add CORS support to the WalletUnlocker proxy

This commit adds the same CORS functionality that's currently in the main gRPC proxy to the WalletUnlocker proxy. This ensures the CORS configuration is carried through all API endpoints
This commit is contained in:
Graham Krizek
2020-08-19 23:06:28 -05:00
parent fc12656a1a
commit 3f944dd337
2 changed files with 9 additions and 8 deletions

2
lnd.go
View File

@@ -1011,7 +1011,7 @@ func waitForWalletPassword(cfg *Config, restEndpoints []net.Addr,
return nil, err
}
srv := &http.Server{Handler: mux}
srv := &http.Server{Handler: allowCORS(mux, cfg.RestCORS)}
for _, restEndpoint := range restEndpoints {
lis, err := lncfg.TLSListenOnAddress(restEndpoint, tlsConf)