Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove to-readable-stream #6685

Merged
merged 3 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@
"terminal-link": "3.0.0",
"through2-filter": "4.0.0",
"through2-map": "4.0.0",
"to-readable-stream": "3.0.0",
"toml": "3.0.0",
"tomlify-j0.4": "3.0.0",
"ulid": "2.3.0",
Expand Down
4 changes: 2 additions & 2 deletions src/utils/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { readFile } from 'fs/promises'
import http, { ServerResponse } from 'http'
import https from 'https'
import { isIPv6 } from 'net'
import { Readable } from 'node:stream'
import path from 'path'
import process from 'process'
import { Duplex } from 'stream'
Expand All @@ -24,7 +25,6 @@ import { jwtDecode } from 'jwt-decode'
import { locatePath } from 'locate-path'
import { Match } from 'netlify-redirector'
import pFilter from 'p-filter'
import toReadableStream from 'to-readable-stream'
import throttle from 'lodash/throttle.js'

import { BaseCommand } from '../commands/index.js'
Expand Down Expand Up @@ -176,7 +176,7 @@ const proxyToExternalUrl = function ({
pathRewrite: () => destURL,
// hide logging
logLevel: 'warn',
...(Buffer.isBuffer(req.originalBody) && { buffer: toReadableStream(req.originalBody) }),
...(Buffer.isBuffer(req.originalBody) && { buffer: Readable.from(req.originalBody) }),
})
// @ts-expect-error TS(2345) FIXME: Argument of type 'Request' is not assignable to parameter of type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>'.
return handler(req, res, () => {})
Expand Down
Loading