Forward HTTP headers to /generate endpoint (Fixes #8790) - #8916
Forward HTTP headers to /generate endpoint (Fixes #8790)#891692subrata wants to merge 5 commits into
Conversation
…rver#8790) The --http-header-forward-pattern flag forwarded matching HTTP request headers to the backend via request.parameters() for the /infer endpoint, but HandleGenerate() never called ForwardHeaders(). As a result the flag had no effect on the /generate endpoint (including the ensemble -> Python backend path) and headers were silently dropped. Add the missing ForwardHeaders(req, irequest) call in HandleGenerate(), matching the placement used by /infer, so the same forwarding behavior applies consistently across both endpoints. Add a regression test (test_http_header_forward_pattern_generate) that POSTs to /generate on both the 'parameter' model and the 'ensemble' (identity -> Python backend) and verifies the forwarded headers are echoed back as request parameters. Fixes triton-inference-server#8790 Signed-off-by: 92subrata <subrata.sarkar@walmart.com>
|
Hi maintainers — this is a small, additive fix + regression test for #8790 ( |
Greptile SummaryThe PR makes configured HTTP header forwarding apply to the
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (5): Last reviewed commit: "Merge branch 'main' into fix/generate-he..." | Re-trigger Greptile |
Address review feedback on triton-inference-server#8916: comparing the key and value arrays as independent sets did not verify their pairwise association, so a response that mapped the right values to the wrong header names would still pass. Reconstruct the mapping with dict(zip(key, value)) and compare it to the expected headers so each forwarded header must keep its correct value. Signed-off-by: 92subrata <subrata.sarkar@walmart.com>
Hi @92subrata , thanks for the PR. The change looks good: One prerequisite : Triton requires all contributors (or their corporate entity) to have a signed Contributor License Agreement on file with triton-cla@nvidia.com. |
What
--http-header-forward-patternforwarded matching HTTP headers to thebackend via
request.parameters()on the/inferendpoint, butHandleGenerate()never calledForwardHeaders(). As a result the flaghad no effect on the
/generateendpoint (including theensemble → Python backend path) and headers were silently dropped.
Fix
Add the missing
ForwardHeaders(req, irequest)call inHandleGenerate(), matching the placement used by/infer, so headerforwarding behaves consistently across both endpoints.
Test
Adds
test_http_header_forward_pattern_generateinqa/L0_parameters,POSTing to
/generateon both theparametermodel and theensemble(identity → Python backend), asserting the forwarded headers come back
as request parameters. Wired into
test.shwith--http-header-forward-pattern MY_HEADER.*.Existing test methods are untouched — the change is purely additive.
Fixes #8790