summaryrefslogtreecommitdiff
path: root/src/auth_manager.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/auth_manager.zig')
-rw-r--r--src/auth_manager.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/auth_manager.zig b/src/auth_manager.zig
index e91339b..8889ca8 100644
--- a/src/auth_manager.zig
+++ b/src/auth_manager.zig
@@ -167,9 +167,9 @@ pub const AuthManager = struct {
};
/// When an auth exchange returns only an origin/base host but the provider's
-/// configured base_url carries an API path segment (e.g. Anthropic providers
-/// configured as `.../v1`), preserve that path on the override. This keeps
-/// dynamic-host exchanges from accidentally dropping a required version prefix.
+/// configured base_url carries an API path segment, preserve that path on the
+/// override. This keeps dynamic-host exchanges from accidentally dropping a
+/// required prefix for providers that still encode one in `base_url`.
fn mergeBaseUrlOverride(
arena: Allocator,
style: panto.APIStyle,
@@ -264,7 +264,7 @@ test "patchCredential: injects key, base_url override, merged headers" {
try t.expectEqualStrings("chatgpt-account-id", live.provider.openai_chat.extra_headers[1].name);
}
-test "patchCredential: anthropic preserves provider path on base_url override" {
+test "patchCredential: anthropic oauth override keeps origin base_url" {
var aa = std.heap.ArenaAllocator.init(t.allocator);
defer aa.deinit();
const arena = aa.allocator();
@@ -272,7 +272,7 @@ test "patchCredential: anthropic preserves provider path on base_url override" {
const prov: config_file.Provider = .{
.name = "copilot-anthropic",
.style = .anthropic_messages,
- .base_url = "https://api.individual.githubcopilot.com/v1",
+ .base_url = "https://api.individual.githubcopilot.com",
.auth_name = "github_copilot",
};
var live: panto.Config = .{ .provider = .{ .anthropic_messages = .{
@@ -286,7 +286,7 @@ test "patchCredential: anthropic preserves provider path on base_url override" {
};
try patchCredential(&live, &prov, cred, arena);
- try t.expectEqualStrings("https://api.individual.githubcopilot.com/v1", live.provider.anthropic_messages.base_url);
+ try t.expectEqualStrings("https://api.individual.githubcopilot.com", live.provider.anthropic_messages.base_url);
}
test "resolveInto: api_key auth is a no-op" {