feat(core): Add Bun and Deno runtime support, unify core loader, unix-socket support and cross-runtime streaming/tests
This commit is contained in:
@@ -447,15 +447,18 @@ export class SmartRequest<T = any> {
|
||||
requestDataFunc = (req: any) => {
|
||||
nodeStream.pipe(req);
|
||||
};
|
||||
// Remove the temporary stream reference
|
||||
delete (this._options as any).__nodeStream;
|
||||
// Don't delete __nodeStream yet - let CoreRequest implementations handle it
|
||||
// Node.js will use requestDataFunc, Bun/Deno will convert the stream
|
||||
} else if ((this._options as any).__rawStreamFunc) {
|
||||
requestDataFunc = (this._options as any).__rawStreamFunc;
|
||||
// Remove the temporary function reference
|
||||
delete (this._options as any).__rawStreamFunc;
|
||||
// Don't delete __rawStreamFunc yet - let CoreRequest implementations handle it
|
||||
}
|
||||
|
||||
|
||||
const request = new CoreRequest(this._url, this._options as any, requestDataFunc);
|
||||
|
||||
// Clean up temporary properties after CoreRequest has been created
|
||||
delete (this._options as any).__nodeStream;
|
||||
delete (this._options as any).__rawStreamFunc;
|
||||
const response = (await request.fire()) as ICoreResponse<R>;
|
||||
|
||||
// Check for 429 status if rate limit handling is enabled
|
||||
|
||||
Reference in New Issue
Block a user