Commit 0d6b887
committed
fix: match HTTPRoute on CR name instead of targetModel for X-Gateway-Model-Name
The HTTPRoute body-routed rules matched X-Gateway-Model-Name against
targetModel, but body-field-to-header sets the header to the ExternalModel
CR name (what /v1/models returns, what clients send). When CR name differs
from targetModel (e.g., company-gpt4 vs gpt-4o), no route matched → 404.
Fix: match on modelName (CR name) instead of ref.targetModel. Routing is
still correct because x-ipp-selected-provider (also in the match) uniquely
identifies the backend. The body model field is still rewritten to
targetModel by model-provider-resolver — the provider receives the correct
model name.
Reverts the header rewrite approach (which would break auth — ipp-pre runs
before the wasm/auth plugin, so overwriting X-Gateway-Model-Name to
targetModel causes Rego model_access lookup and maas-api subscription
validation to fail).1 parent 726eb4d commit 0d6b887
3 files changed
Lines changed: 5 additions & 6 deletions
File tree
- pkg
- controller/externalmodel
- plugins/model-provider-resolver
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| 320 | + | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
| 360 | + | |
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
340 | | - | |
341 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | 186 | | |
188 | 187 | | |
189 | 188 | | |
| |||
0 commit comments