From 786ca6e76940159cd33798ac2d8984caf829ae8b Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sun, 20 Jul 2025 07:27:13 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- src/http/SOCKSProxy.zig | 8 ++++---- test/js/bun/http/socks-proxy-env.test.ts | 4 ++-- test/js/bun/http/socks-proxy.test.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/http/SOCKSProxy.zig b/src/http/SOCKSProxy.zig index 434e08c641..664dd2a995 100644 --- a/src/http/SOCKSProxy.zig +++ b/src/http/SOCKSProxy.zig @@ -58,7 +58,7 @@ const SOCKSReply = enum(u8) { pub fn create(allocator: std.mem.Allocator, proxy_url: URL, destination_host: []const u8, destination_port: u16) !*SOCKSProxy { // Clone the destination_host to ensure memory safety const cloned_host = try allocator.dupe(u8, destination_host); - + const socks_proxy = bun.new(SOCKSProxy, .{ .ref_count = .init(), .proxy_url = proxy_url, @@ -83,12 +83,12 @@ pub fn sendAuthHandshake(this: *SOCKSProxy, comptime is_ssl: bool, socket: NewHT // Buffer the write in case it's incomplete this.write_buffer.clearRetainingCapacity(); try this.write_buffer.appendSlice(&auth_request); - + const bytes_written = socket.write(this.write_buffer.items); if (bytes_written != this.write_buffer.items.len) { return error.IncompleteWrite; } - + this.state = .auth_handshake; } @@ -142,7 +142,7 @@ pub fn sendConnectRequest(this: *SOCKSProxy, comptime is_ssl: bool, socket: NewH if (bytes_written != this.write_buffer.items.len) { return error.IncompleteWrite; } - + this.state = .connect_request; } diff --git a/test/js/bun/http/socks-proxy-env.test.ts b/test/js/bun/http/socks-proxy-env.test.ts index e48dc4c3f0..9ab35d5645 100644 --- a/test/js/bun/http/socks-proxy-env.test.ts +++ b/test/js/bun/http/socks-proxy-env.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "bun:test"; -import { tempDirWithFiles, bunExe, bunEnv } from "harness"; +import { bunEnv, bunExe, tempDirWithFiles } from "harness"; describe("SOCKS proxy environment variables", () => { test("should read SOCKS proxy from http_proxy environment variable", async () => { @@ -100,4 +100,4 @@ describe("SOCKS proxy environment variables", () => { expect(stdout.trim()).toBe("INVALID_PROXY_ERROR"); }); -}); \ No newline at end of file +}); diff --git a/test/js/bun/http/socks-proxy.test.ts b/test/js/bun/http/socks-proxy.test.ts index aa6d144343..52c513eb21 100644 --- a/test/js/bun/http/socks-proxy.test.ts +++ b/test/js/bun/http/socks-proxy.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "bun:test"; -import { tempDirWithFiles, bunExe, bunEnv } from "harness"; +import { bunEnv, bunExe, tempDirWithFiles } from "harness"; describe("SOCKS proxy", () => { test("should detect SOCKS5 proxy URLs in environment variables", async () => { @@ -109,4 +109,4 @@ describe("SOCKS proxy", () => { expect(output).toContain("socks5-attempted"); expect(output).toContain("socks5h-attempted"); }); -}); \ No newline at end of file +});