Compare commits

...

2 Commits

Author SHA1 Message Date
9ec97d8aa2 fix
Some checks failed
continuous-integration/drone/push Build is failing
2021-01-12 22:04:24 +01:00
1af8c0702c test with additional cookies 2021-01-12 21:26:19 +01:00
2 changed files with 4 additions and 2 deletions

View File

@ -48,7 +48,7 @@ class GatewayClass {
return null;
let auth = null;
run_regex (
/(?:^|;)(?<name>[^;=]+)=(?<value>[^;]+)/gu,
/(?:^|;)\s*(?<name>[^;=]+)=(?<value>[^;]+)/gu,
req.headers.cookie,
(res: RegExpMatchArray) => {
if (res.groups?.name === this._options.cookie_name)

View File

@ -61,7 +61,9 @@ describe ('gateway', () => {
it ('should allow a valid access token using cookies', async () => {
const token = await authority.sign ('access_token', 60);
const resp = await get ({ cookie: `cookie_jar=${token.signature}` });
const resp = await get (
{ cookie: `foo=bar;cookie_jar=${token.signature};asd=efg` }
);
expect (resp.statusCode)
.toEqual (200);
expect (JSON.parse (resp.body as string).token_id)