fix(guard): handle bypass preflight before query parse#4944
fix(guard): handle bypass preflight before query parse#4944NathanFlurry merged 1 commit intomainfrom
Conversation
Preview packages published to npmInstall with: npm install rivetkit@pr-4944All packages published as Engine binary is shipped via Docker images: docker pull rivetdev/engine:slim-cbab65f
docker pull rivetdev/engine:full-cbab65fIndividual packagesnpm install rivetkit@pr-4944
npm install @rivetkit/react@pr-4944
npm install @rivetkit/rivetkit-napi@pr-4944
npm install @rivetkit/workflow-engine@pr-4944 |
PR Review: fix(guard): handle bypass preflight before query parseOverviewThis PR fixes a bug where CORS preflight (OPTIONS) requests to the actor gateway would fail if query parameters were invalid — because What's Good
IssuesBug: In // engine/packages/guard/src/routing/actor_path.rs
"get" => {
if rvt.input.is_some()
|| rvt.region.is_some()
|| rvt.crash_policy.is_some()
|| rvt.runner.is_some() // pool not checked
{
return Err(errors::QueryGetDisallowedParams.build());
}
...
}A request like Clippy lint: base_path
.split('/')
.filter(|segment| !segment.is_empty())
.next()
== Some("gateway")This triggers the base_path
.split('/')
.find(|segment| !segment.is_empty())
== Some(&"gateway")TODO left in production path // engine/packages/guard/src/routing/pegboard_gateway/mod.rs
ParsedActorPath::Direct(path) => (
...
// TODO:
false,
),
Minor
SummaryThe preflight fix is correct and important. The two items that need attention before merging are the missing |
0933767 to
a4663b0
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: