Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the body param #308

Merged
merged 2 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": [
"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",
"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