Merge pull request #130 from guggero/lsat-header-rfc

lsat: change WWW-Authenticate header format
pull/132/head
Olaoluwa Osuntokun 4 years ago committed by GitHub
commit 68ebd14235
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -52,7 +52,7 @@ var (
// authHeaderRegex is the regular expression the payment challenge must
// match for us to be able to parse the macaroon and invoice.
authHeaderRegex = regexp.MustCompile(
"LSAT macaroon='(.*?)' invoice='(.*?)'",
"LSAT macaroon=\"(.*?)\", invoice=\"(.*?)\"",
)
)

@ -324,6 +324,6 @@ func makeAuthHeader(macBytes []byte) string {
"3l2ahrqsfpp3x9et2e20v6pu37c5d9vax37wxq72un98k6vcx9fz94w0qf23" +
"7cm2rqv9pmn5lnexfvf5579slr4zq3u8kmczecytdx0xg9rwzngp7e6guwqp" +
"qlhssu04sucpnz4axcv2dstmknqq6jsk2l"
return fmt.Sprintf("LSAT macaroon='%s' invoice='%s'",
return fmt.Sprintf("LSAT macaroon=\"%s\", invoice=\"%s\"",
base64.StdEncoding.EncodeToString(macBytes), invoice)
}

Loading…
Cancel
Save