@@ -86,9 +86,9 @@ func TestAnthropic_CreateInterceptor(t *testing.T) {
8686 body := `{"model": "claude-opus-4-5", "max_tokens": 1024, "messages": [{"role": "user", "content": "hello"}], "stream": false}`
8787 req := httptest .NewRequest (http .MethodPost , routeMessages , bytes .NewBufferString (body ))
8888 req .Header .Set ("Anthropic-Beta" , betaHeader )
89- // Simulate a client sending its own auth credential, which must be replaced
90- // by aibridge with the configured provider key.
91- req . Header . Set ( "Authorization" , "Bearer fake-client-bearer" )
89+ req . Header . Set ( "X-Custom-Header" , "should-be-forwarded" )
90+ // In centralized mode, http.go strips Authorization and X-Api-Key
91+ // before CreateInterceptor is called, so neither is set here.
9292 w := httptest .NewRecorder ()
9393
9494 interceptor , err := provider .CreateInterceptor (w , req , testTracer )
@@ -105,9 +105,12 @@ func TestAnthropic_CreateInterceptor(t *testing.T) {
105105 // Verify the full Anthropic-Beta header (all betas) was forwarded unchanged.
106106 assert .Equal (t , betaHeader , receivedHeaders .Get ("Anthropic-Beta" ), "Anthropic-Beta header must be forwarded unchanged to upstream" )
107107
108- // Verify aibridge's configured key was used and the client's auth credential was not forwarded .
108+ // Verify aibridge's configured key was used.
109109 assert .Equal (t , "test-key" , receivedHeaders .Get ("X-Api-Key" ), "upstream must receive configured provider key" )
110- assert .Empty (t , receivedHeaders .Get ("Authorization" ), "client Authorization header must not reach upstream" )
110+ assert .Empty (t , receivedHeaders .Get ("Authorization" ), "Authorization should not be set in centralized mode" )
111+
112+ // Verify custom client headers are forwarded.
113+ assert .Equal (t , "should-be-forwarded" , receivedHeaders .Get ("X-Custom-Header" ), "custom client headers should be forwarded" )
111114 })
112115
113116 byokTests := []struct {
0 commit comments