Skip to content

Commit 84ea20b

Browse files
committed
fix a conditional statement that may effect Cloudflare token issuing
1 parent 3e39527 commit 84ea20b

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "privacy-pass",
3-
"version": "3.6.3",
3+
"version": "3.6.4",
44
"private": true,
55
"contributors": [
66
"Suphanat Chunhapanya <[email protected]>",

public/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "__MSG_appName__",
33
"description": "__MSG_appDescription__",
4-
"version": "3.6.3",
4+
"version": "3.6.4",
55
"manifest_version": 2,
66
"default_locale": "en",
77
"icons": {

src/background/providers/cloudflare.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ export class CloudflareProvider extends Provider {
203203
details: chrome.webRequest.WebRequestHeadersDetails,
204204
): chrome.webRequest.BlockingResponse | void {
205205

206-
if (this.issueInfo !== null) {
206+
if (
207+
(this.issueInfo !== null) &&
208+
(this.issueInfo.requestId === details.requestId)
209+
) {
207210
if (this.matchesIssuingHeadersCriteria(details)) {
208211
const issueInfo: IssueInfo = { ...this.issueInfo };
209212

@@ -232,7 +235,10 @@ export class CloudflareProvider extends Provider {
232235
private redeemToken(
233236
details: chrome.webRequest.WebRequestHeadersDetails,
234237
): chrome.webRequest.BlockingResponse | void {
235-
if (this.redeemInfo === null || details.requestId !== this.redeemInfo.requestId) {
238+
if (
239+
(this.redeemInfo === null) ||
240+
(this.redeemInfo.requestId !== details.requestId)
241+
) {
236242
return;
237243
}
238244

@@ -267,7 +273,12 @@ export class CloudflareProvider extends Provider {
267273
let href: string;
268274
let url: URL;
269275

270-
if (this.issueInfo === null) return false;
276+
if (
277+
(this.issueInfo === null) ||
278+
(this.issueInfo.requestId !== details.requestId)
279+
) {
280+
return false;
281+
}
271282

272283
href = this.issueInfo.url;
273284
url = new URL(href);

0 commit comments

Comments
 (0)