-
Notifications
You must be signed in to change notification settings - Fork 896
Description
Describe the bug
HTTP trigger preprocessor functions are not invoked when the target script runs on a dedicated worker. The raw HTTP event is passed directly to main() instead of being processed by preprocessor() first. Tested with both Python and Bun runtimes.
Since to_main_args() only maps the request body to function arguments, path parameters are completely inaccessible on dedicated workers without a working preprocessor.
We also observed cross-endpoint interference: a GET request to one route triggered the script registered to a different route's POST handler. This happened when one script had a preprocessor and the other did not, both on dedicated workers. We were unable to identify the exact cause.
To reproduce
Create a script with a preprocessor() function that extracts path params
2. Enable dedicated worker on the script
3. Create an HTTP trigger with a parameterized route (e.g. v1/test/:action_id)
4. Send a request to the route
5. main() receives action_id=None and the preprocessor was not called
Disabling the dedicated worker on the same script makes the preprocessor work correctly.
Expected behavior
preprocessor() should be invoked on dedicated workers the same way it is on normal workers, with its return value spread as arguments to main().
Screenshots
No response
Browser information
No response
Application version
No response
Additional Context
No response