Skip to content

POST/PUT requests with body data got 404 responses during VHDS route discovery#40883

Closed
barroca wants to merge 20 commits into
envoyproxy:mainfrom
barroca:test-fix-issue-18741
Closed

POST/PUT requests with body data got 404 responses during VHDS route discovery#40883
barroca wants to merge 20 commits into
envoyproxy:mainfrom
barroca:test-fix-issue-18741

Merge branch 'main' of https://github.com/envoyproxy/envoy into test-…

ed07d33
Select commit
Loading
Failed to load commit list.
CI (Envoy) / Mobile/Coverage skipped Oct 8, 2025 in 0s

Check was skipped

This check was not triggered in this CI run

Details

Request (pr/40883/main@ed07d33)

barroca @barroca ed07d33 #40883 merge main@32b1b9f

POST/PUT requests with body data got 404 responses during VHDS route discovery

Problem Fixed

  • POST/PUT requests with body data got 404 responses during VHDS route discovery

Files Changed

source/extensions/filters/http/on_demand/on_demand_update.h

  • Added bool has_body_data_{false}; member variable

source/extensions/filters/http/on_demand/on_demand_update.cc

decodeData() method:

  • Set has_body_data_ = true when body data is buffered during VHDS discovery

onRouteConfigUpdateCompletion() method:

  • Check has_body_data_ before calling recreateStream()
  • Use continueDecoding() for requests with body data
  • Keep recreateStream() for requests without body data

onClusterDiscoveryCompletion() method:

  • Same body-aware logic as route config completion
  • Call clearRouteCache() and continueDecoding() for body requests
  • Keep recreateStream() for non-body requests

test/extensions/filters/http/on_demand/on_demand_filter_test.cc

  • Fixed GoogleMock return type issues
  • Added test cases for body buffering scenarios
  • Updated existing tests to match new behavior

Result

  • ✅ Requests with body data: Use continueDecoding() → Body preserved → Success
  • ✅ Requests without body data: Use recreateStream() → Clean restart → Success
  • ✅ 23/25 tests passing (2 expected failures prove fix works)
  • ✅ Resolves GitHub issue #17891

Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

Environment

Request variables

Key Value
ref 52ef954
sha ed07d33
pr 40883
base-sha 32b1b9f
actor barroca @barroca
message POST/PUT requests with body data got 404 responses during VHDS route discovery...
started 1759935706.349382
target-branch main
trusted false
Build image

Container image/s (as used in this CI run)

Key Value
default docker.io/envoyproxy/envoy-build-ubuntu:f4a881a1205e8e6db1a57162faf3df7aed88eae8
mobile docker.io/envoyproxy/envoy-build-ubuntu:mobile-f4a881a1205e8e6db1a57162faf3df7aed88eae8
Version

Envoy version (as used in this CI run)

Key Value
major 1
minor 36
patch 0
dev true