Skip to content

Commit

Permalink
Merge pull request #308 from ppopth/update-the-body-param
Browse files Browse the repository at this point in the history
Update the body param
  • Loading branch information
ppopth authored Feb 22, 2022
2 parents b9bf3ac + cbbe6c7 commit 7bc07eb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "privacy-pass",
"version": "3.0.1",
"version": "3.0.2",
"contributors": [

This comment has been minimized.

Copy link
@joshuamorris23
"Suphanat Chunhapanya <[email protected]>",
"Armando Faz <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Privacy Pass",
"manifest_version": 2,
"description": "Client support for Privacy Pass anonymous authorization protocol.",
"version": "3.0.1",

This comment has been minimized.

Copy link
@joshuamorris23
"version": "3.0.2",
"icons": {
"32": "icons/32/gold.png",
"48": "icons/48/gold.png",
Expand Down
14 changes: 7 additions & 7 deletions src/background/providers/cloudflare.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('issuance', () => {
requestBody: {
formData: {
['h-captcha-response']: ['body-param'],
['cf_captcha_kind']: ['body-param'],
['cf_ch_verify']: ['body-param'],
},
},
};
Expand All @@ -120,13 +120,13 @@ describe('issuance', () => {
expect(issueInfo!.requestId).toEqual(details.requestId);
expect(issueInfo!.formData).toStrictEqual({
['h-captcha-response']: 'body-param',
['cf_captcha_kind']: 'body-param',
['cf_ch_verify']: 'body-param',
});
});

/*
* The request is invalid only if the body has both
* 'h-captcha-response' and 'cf_captcha_kind' params.
* 'h-captcha-response' and 'cf_ch_verify' params.
*/
test('invalid request', async () => {
const storage = new StorageMock();
Expand Down Expand Up @@ -174,7 +174,7 @@ describe('issuance', () => {
requestId: 'xxx',
formData: {
['h-captcha-response']: 'body-param',
['cf_captcha_kind']: 'body-param',
['cf_ch_verify']: 'body-param',
},
};
provider['issueInfo'] = issueInfo;
Expand Down Expand Up @@ -202,7 +202,7 @@ describe('issuance', () => {
expect(issue.mock.calls.length).toBe(1);
expect(issue).toHaveBeenCalledWith('https://captcha.website/?__cf_chl_f_tk=token', {
['h-captcha-response']: 'body-param',
['cf_captcha_kind']: 'body-param',
['cf_ch_verify']: 'body-param',
});

expect(navigateUrl.mock.calls.length).toBe(1);
Expand Down Expand Up @@ -230,7 +230,7 @@ describe('issuance', () => {
requestId: 'xxx',
formData: {
['h-captcha-response']: 'body-param',
['cf_captcha_kind']: 'body-param',
['cf_ch_verify']: 'body-param',
},
};
provider['issueInfo'] = issueInfo;
Expand All @@ -253,7 +253,7 @@ describe('issuance', () => {
expect(issue.mock.calls.length).toBe(1);
expect(issue).toHaveBeenCalledWith('https://captcha.website/?__cf_chl_f_tk=token', {
['h-captcha-response']: 'body-param',
['cf_captcha_kind']: 'body-param',
['cf_ch_verify']: 'body-param',
});

expect(navigateUrl.mock.calls.length).toBe(1);
Expand Down
2 changes: 1 addition & 1 deletion src/background/providers/cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const ISSUANCE_BODY_PARAM_NAME = 'blinded-tokens';
const COMMITMENT_URL =
'https://raw.githubusercontent.com/privacypass/ec-commitments/master/commitments-p256.json';

const QUALIFIED_BODY_PARAMS = ['h-captcha-response', 'cf_captcha_kind'];
const QUALIFIED_BODY_PARAMS = ['h-captcha-response', 'cf_ch_verify'];

const CHL_BYPASS_SUPPORT = 'cf-chl-bypass';
const DEFAULT_ISSUING_HOSTNAME = 'captcha.website';
Expand Down

0 comments on commit 7bc07eb

Please sign in to comment.