Skip to content

Commit e7ae009

Browse files
authored
chore(refactor): use node: protocol imports (#1127)
1 parent bd34afb commit e7ae009

20 files changed

+37
-31
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"micromatch": "^4.0.8"
9898
},
9999
"engines": {
100-
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
100+
"node": "^14.18.0 || ^16.10.0 || >=18.0.0"
101101
},
102102
"commitlint": {
103103
"extends": [

src/factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type * as http from 'http';
1+
import type * as http from 'node:http';
22

33
import { HttpProxyMiddleware } from './http-proxy-middleware';
44
import type { NextFunction, Options, RequestHandler } from './types';

src/handlers/fix-request-body.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type * as http from 'http';
2-
import * as querystring from 'querystring';
1+
import type * as http from 'node:http';
2+
import * as querystring from 'node:querystring';
33

44
export type BodyParserLikeRequest = http.IncomingMessage & { body?: any };
55

src/handlers/response-interceptor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type * as http from 'http';
2-
import * as zlib from 'zlib';
1+
import type * as http from 'node:http';
2+
import * as zlib from 'node:zlib';
33

44
import { Debug } from '../debug';
55
import { getFunctionName } from '../utils/function';

src/http-proxy-middleware.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import type * as http from 'http';
1+
import type * as http from 'node:http';
2+
import type * as https from 'node:https';
3+
import type * as net from 'node:net';
4+
25
import * as httpProxy from 'http-proxy';
3-
import type * as https from 'https';
4-
import type * as net from 'net';
56

67
import { verifyConfig } from './configuration';
78
import { Debug as debug } from './debug';

src/legacy/create-proxy-middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type * as http from 'http';
1+
import type * as http from 'node:http';
22

33
import { Debug } from '../debug';
44
import { createProxyMiddleware } from '../factory';

src/legacy/options-adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as url from 'url';
1+
import * as url from 'node:url';
22

33
import { Debug } from '../debug';
44
import { getLogger } from '../logger';

src/legacy/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type * as http from 'http';
1+
import type * as http from 'node:http';
22

33
import { Options } from '../types';
44

src/path-filter.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import type * as http from 'http';
1+
import type * as http from 'node:http';
2+
import * as url from 'node:url';
3+
24
import * as isGlob from 'is-glob';
35
import * as micromatch from 'micromatch';
4-
import * as url from 'url';
56

67
import { ERRORS } from './errors';
78
import type { Filter } from './types';

src/plugins/default/error-response-plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type * as http from 'http';
2-
import type { Socket } from 'net';
1+
import type * as http from 'node:http';
2+
import type { Socket } from 'node:net';
33

44
import { getStatusCode } from '../../status-code';
55
import { Plugin } from '../../types';

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy