mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-28 23:11:19 -07:00
Disallow unsafe type assertions (#18688)
This commit is contained in:
committed by
GitHub
parent
bce1caefd0
commit
fd65416a2f
@@ -147,7 +147,8 @@ export class ActivityLogger extends EventEmitter {
|
||||
? input
|
||||
: input instanceof URL
|
||||
? input.toString()
|
||||
: (input as any).url;
|
||||
: // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
(input as any).url;
|
||||
if (url.includes('127.0.0.1') || url.includes('localhost'))
|
||||
return originalFetch(input, init);
|
||||
|
||||
@@ -311,6 +312,7 @@ export class ActivityLogger extends EventEmitter {
|
||||
req.write = function (chunk: any, ...etc: any[]) {
|
||||
if (chunk) {
|
||||
const encoding =
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
typeof etc[0] === 'string' ? (etc[0] as BufferEncoding) : undefined;
|
||||
requestChunks.push(
|
||||
Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding),
|
||||
@@ -322,6 +324,7 @@ export class ActivityLogger extends EventEmitter {
|
||||
req.end = function (this: any, chunk: any, ...etc: any[]) {
|
||||
if (chunk && typeof chunk !== 'function') {
|
||||
const encoding =
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
typeof etc[0] === 'string' ? (etc[0] as BufferEncoding) : undefined;
|
||||
requestChunks.push(
|
||||
Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding),
|
||||
|
||||
Reference in New Issue
Block a user