Skip to content

Commit bbc8295

Browse files
committed
lsat: change WWW-Authenticate header format
To be compliant with RFC 7235 section 4.1 we change the format of the WWW-Authenticate header field to double quoted and comma separated fields.
1 parent 5e00ce6 commit bbc8295

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lsat/interceptor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ var (
5252
// authHeaderRegex is the regular expression the payment challenge must
5353
// match for us to be able to parse the macaroon and invoice.
5454
authHeaderRegex = regexp.MustCompile(
55-
"LSAT macaroon='(.*?)' invoice='(.*?)'",
55+
"LSAT macaroon=\"(.*?)\", invoice=\"(.*?)\"",
5656
)
5757
)
5858

lsat/interceptor_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,6 @@ func makeAuthHeader(macBytes []byte) string {
324324
"3l2ahrqsfpp3x9et2e20v6pu37c5d9vax37wxq72un98k6vcx9fz94w0qf23" +
325325
"7cm2rqv9pmn5lnexfvf5579slr4zq3u8kmczecytdx0xg9rwzngp7e6guwqp" +
326326
"qlhssu04sucpnz4axcv2dstmknqq6jsk2l"
327-
return fmt.Sprintf("LSAT macaroon='%s' invoice='%s'",
327+
return fmt.Sprintf("LSAT macaroon=\"%s\", invoice=\"%s\"",
328328
base64.StdEncoding.EncodeToString(macBytes), invoice)
329329
}

0 commit comments

Comments
 (0)