File tree Expand file tree Collapse file tree 2 files changed +1
-58
lines changed Expand file tree Collapse file tree 2 files changed +1
-58
lines changed Original file line number Diff line number Diff line change @@ -102,37 +102,6 @@ export class CloudflareContext extends RecaptchaContext {
102
102
) ;
103
103
}
104
104
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
-
136
105
async fetch_list_firewall_policies (
137
106
req : RequestInfo ,
138
107
options ?: RequestInit ,
Original file line number Diff line number Diff line change 20
20
21
21
22
22
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
-
48
23
49
24
describe ( 'Check Different Actions' , ( ) => {
50
25
// const endpointUrl = process.env.CLOUDFLARE_ENDPOINT as string;
@@ -58,8 +33,7 @@ describe('Check Different Actions', () => {
58
33
expect ( response . status ) . toEqual ( 200 ) ;
59
34
60
35
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' ) ;
63
37
} ) ;
64
38
65
39
test ( 'Access the allow page' , async ( ) => {
You can’t perform that action at this time.
0 commit comments