Skip to content

Commit 5d37169

Browse files
authored
conform to whip auth header spec, fixes: #128 (#141)
Section 4.5 of draft-ietf-wish-whip-08 says: WHIP endpoints and resources MAY require the HTTP request to be authenticated using an HTTP Authorization header field with a Bearer token as specified in [RFC6750] section 2.1. Section 2.1 of RFC 6750 specifies the syntax as: credentials = "Bearer" 1*SP b64token So lines 8 and 18 of WhipProtocol.ts should say
1 parent 06092ab commit 5d37169

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/sdk/src/WHIPProtocol.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class WHIPProtocol {
55
method: "POST",
66
headers: {
77
"Content-Type": "application/sdp",
8-
"Authorization": authKey
8+
"Authorization": `Bearer ${authKey}`
99
},
1010
body: sdp
1111
});
@@ -15,7 +15,7 @@ export class WHIPProtocol {
1515
return fetch(url, {
1616
method: "OPTIONS",
1717
headers: {
18-
"Authorization": authKey,
18+
"Authorization": `Bearer ${authKey}`,
1919
}
2020
});
2121
}
@@ -31,7 +31,8 @@ export class WHIPProtocol {
3131
method: "PATCH",
3232
headers: {
3333
"Content-Type": "application/trickle-ice-sdpfrag",
34-
"ETag": eTag
34+
"ETag": eTag,
35+
"Authorization": `Bearer ${authKey}`,
3536
},
3637
body: sdp
3738
});

0 commit comments

Comments
 (0)