Commit 3aa31ffd86

Tadej Gašparovič <tadej@duplex.si>
2025-08-31 15:40:21
Fix regression: std.http.Client basic authorization sending user:user instead of user:password when passed in URI
1 parent ab99dd9
Changed files (1)
lib
std
lib/std/http/Client.zig
@@ -1375,7 +1375,7 @@ pub const basic_authorization = struct {
         var buf: [max_user_len + 1 + max_password_len]u8 = undefined;
         var w: Writer = .fixed(&buf);
         const user: Uri.Component = uri.user orelse .empty;
-        const password: Uri.Component = uri.user orelse .empty;
+        const password: Uri.Component = uri.password orelse .empty;
         user.formatUser(&w) catch unreachable;
         w.writeByte(':') catch unreachable;
         password.formatPassword(&w) catch unreachable;