Rename access token param to be shorter (#40)

This commit is contained in:
Simon J
2021-08-31 22:16:20 +10:00
committed by GitHub
parent f045867554
commit 9dcac1f324
3 changed files with 5 additions and 5 deletions

View File

@@ -30,7 +30,7 @@ import _, { shuffle } from "underscore";
import morgan from "morgan"; import morgan from "morgan";
import { takeWithRepeats } from "./utils"; import { takeWithRepeats } from "./utils";
export const BONOB_ACCESS_TOKEN_HEADER = "bonob-access-token"; export const BONOB_ACCESS_TOKEN_HEADER = "bat";
interface RangeFilter extends Transform { interface RangeFilter extends Transform {
range: (length: number) => string; range: (length: number) => string;

View File

@@ -368,7 +368,7 @@ function bindSmapiSoapServiceToExpress(
const urlWithToken = (accessToken: string) => const urlWithToken = (accessToken: string) =>
bonobUrl.append({ bonobUrl.append({
searchParams: { searchParams: {
"bonob-access-token": accessToken, "bat": accessToken,
}, },
}); });

View File

@@ -448,7 +448,7 @@ describe("api", () => {
const accessToken = `accessToken-${uuid()}`; const accessToken = `accessToken-${uuid()}`;
const bonobUrlWithAccessToken = bonobUrl.append({ const bonobUrlWithAccessToken = bonobUrl.append({
searchParams: { "bonob-access-token": accessToken }, searchParams: { "bat": accessToken },
}); });
const service = bonobService("test-api", 133, bonobUrl, "AppLink"); const service = bonobService("test-api", 133, bonobUrl, "AppLink");
@@ -2428,7 +2428,7 @@ describe("api", () => {
}) })
.href(), .href(),
httpHeaders: { httpHeaders: {
header: "bonob-access-token", header: "bat",
value: accessToken, value: accessToken,
}, },
}); });
@@ -2510,7 +2510,7 @@ describe("api", () => {
expect(root[0]).toEqual({ expect(root[0]).toEqual({
getMediaMetadataResult: track( getMediaMetadataResult: track(
bonobUrl.with({ bonobUrl.with({
searchParams: { "bonob-access-token": accessToken }, searchParams: { "bat": accessToken },
}), }),
someTrack someTrack
), ),