Skip to content

Commit b84c9a9

Browse files
committed
clean redundant comments
1 parent 04c72df commit b84c9a9

File tree

2 files changed

+1
-58
lines changed

2 files changed

+1
-58
lines changed

bindings/cloudflare/src/index.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -102,37 +102,6 @@ export class CloudflareContext extends RecaptchaContext {
102102
);
103103
}
104104

105-
// async injectRecaptchaJs(resp: Response): Promise<Response> {
106-
// const sessionKey = this.config.sessionSiteKey;
107-
108-
// // Check if the response is HTML
109-
// const contentType = resp.headers.get('content-type');
110-
// if (!contentType || !contentType.includes('text/html')) {
111-
// return resp; // If not HTML, don't transform
112-
// }
113-
114-
// // Construct the reCAPTCHA script URL
115-
// const recaptchaJsUrl = new URL(RECAPTCHA_JS); // Use URL constructor
116-
// recaptchaJsUrl.searchParams.set('render', sessionKey);
117-
// recaptchaJsUrl.searchParams.set('waf', 'session');
118-
119-
// const RECAPTCHA_JS_SCRIPT = `<script src="${recaptchaJsUrl.toString()}" async defer></script>`;
120-
121-
// // Error handling
122-
// try {
123-
// return await new HTMLRewriter()
124-
// .on("head", {
125-
// element(element: any) {
126-
// element.append(RECAPTCHA_JS_SCRIPT, { html: true });
127-
// },
128-
// })
129-
// .transform(resp); // Directly transform the original response
130-
// } catch (error) {
131-
// console.error('Error injecting reCAPTCHA JS:', error);
132-
// return new Response('Error processing request', { status: 500 });
133-
// }
134-
// }
135-
136105
async fetch_list_firewall_policies(
137106
req: RequestInfo,
138107
options?: RequestInit,

integration/cf_endpoint.test.ts

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,6 @@
2020

2121

2222
import { expect, test, describe } from 'vitest';
23-
// import puppeteer from 'puppeteer';
24-
25-
// async function runPuppeteer() {
26-
// // Launch a Chromium browser instance
27-
// const browser = await puppeteer.launch({
28-
// headless: false,
29-
// });
30-
31-
// const page = await browser.newPage();
32-
33-
// // Navigate to a website
34-
// await page.goto("https://www.branowl.xyz/");
35-
36-
// // Take a screenshot of the page
37-
// // await page.screenshot({ path: 'screenshot.png' });
38-
39-
// // Get the page title
40-
// const title = await page.title();
41-
// console.log(`Page title: ${title}`);
42-
43-
// await browser.close();
44-
// }
45-
46-
// runPuppeteer();
47-
4823

4924
describe('Check Different Actions', () => {
5025
// const endpointUrl = process.env.CLOUDFLARE_ENDPOINT as string;
@@ -58,8 +33,7 @@ describe('Check Different Actions', () => {
5833
expect(response.status).toEqual(200);
5934

6035
const data = await response.json();
61-
// console.log(data)
62-
// expect(data.headers).toHaveProperty('cf-connecting-ip');
36+
expect(data.headers).toHaveProperty('cf-connecting-ip');
6337
});
6438

6539
test('Access the allow page', async () => {

0 commit comments

Comments
 (0)