Skip to content

Commit 79e069b

Browse files
committed
fix(mitm): enable cache handler for test
1 parent 1d4ab06 commit 79e069b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mitm/test/http2.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import HttpRequestHandler from '../handlers/HttpRequestHandler';
99
import HeadersHandler from '../handlers/HeadersHandler';
1010
import MitmRequestContext from '../lib/MitmRequestContext';
1111
import { parseRawHeaders } from '../lib/Utils';
12+
import CacheHandler from '../handlers/CacheHandler';
1213

1314
const mocks = {
1415
httpRequestHandler: {
@@ -222,6 +223,8 @@ test('should handle h2 client going to h1 request', async () => {
222223

223224
test('should handle cache headers for h2', async () => {
224225
const etags: string[] = [];
226+
CacheHandler.isEnabled = true;
227+
Helpers.onClose(() => (CacheHandler.isEnabled = false));
225228
const server = await Helpers.runHttp2Server((req, res1) => {
226229
if (req.headers[':path'] === '/cached') {
227230
etags.push(req.headers['if-none-match'] as string);

0 commit comments

Comments
 (0)