Skip to content

Commit 7dc817a

Browse files
committed
fix authorization header
1 parent da2a73d commit 7dc817a

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

update_remote_settings_records.mjs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,11 @@ const rsBrowsersCollectionEndpoint = `${process.env.SERVER}/buckets/main-workspa
5555
const rsBrowsersRecordsEndpoint = `${rsBrowsersCollectionEndpoint}/records`;
5656
const isDryRun = process.env.DRY_RUN == "1";
5757

58-
59-
if (process.env.AUTHORIZATION.includes("Bearer")) {
60-
const headers = {
61-
"Content-Type": "application/json",
62-
Authorization: process.env.AUTHORIZATION,
63-
}
64-
} else {
65-
const headers = {
66-
"Content-Type": "application/json",
67-
Authorization: `Basic ${btoa(${process.env.AUTHORIZATION})}`,
68-
};
58+
const headers = {
59+
"Content-Type": "application/json",
60+
Authorization: process.env.AUTHORIZATION.startsWith("Bearer ")
61+
? process.env.AUTHORIZATION
62+
: `Basic ${btoa(process.env.AUTHORIZATION)}`,
6963
}
7064

7165
update()

0 commit comments

Comments
 (0)