Skip to content

fix: invalidate relative-path Location targets - #151

Merged
jonbaldie merged 1 commit into
masterfrom
fleet/worktree-varnish-147
Oct 17, 2026
Merged

jonbaldie merged 1 commit into
masterfrom
fleet/worktree-varnish-147

Conversation

@jonbaldie

Copy link
Copy Markdown
Owner

Summary

successful unsafe response
  Location / Content-Location: item
  resolve against /dir/mutate → /dir/item
  reduce literal dot segments; preserve query; discard fragment
  ban the same-host cached target

Fixes #147. The cache policy explicitly skipped relative paths before constructing a ban. Both headers now resolve against the unsafe request URL. Eight bounded reduction passes fall back to a conservative same-host ban for unusually deep navigation; scheme-relative references remain unsupported.

Evidence

  • Before: make test-hostile-unsafe-location failed twice: expected GET relative-Location-item target after POST cache miss, got 'HIT', preserving the original backend request ID.
    After: real HTTP regressions pass for both headers, dot/parent segments (including trailing parents and empty segments), queries/fragments, deep-navigation fallback, unrelated-object preservation, and path-absolute/absolute controls.
  • COMPOSE_PARALLEL_LIMIT=1 make -j1 test test-e2e-hard passed on the final revision, including the invalidation mutant canary.
  • Original issue replay.sh passed its relative-reference scenario three times: warm GET HIT, then MISS after relative Location, Content-Location, and the path-absolute control.

Merge Danger

Door: two-way

VCL and fixture changes only; revertable without data migration.

Blast Radius: cache

Unusually deep unresolved dot navigation invalidates all objects on the same host rather than risking stale data. Ordinary paths preserve unrelated objects; cross-host behavior is unchanged.

Relative-path Location and Content-Location were explicitly skipped before the ban. Resolve them against the unsafe request directory, reduce literal dot segments with a conservative same-host fallback, and preserve query identity. Real HTTP regressions verify cache and origin request IDs, trailing parent segments, unrelated objects, and existing reference forms.
@jonbaldie
jonbaldie merged commit c5d5474 into master Oct 17, 2026
2 checks passed
@jonbaldie
jonbaldie deleted the fleet/worktree-varnish-147 branch October 17, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: relative-path Location and Content-Location do not invalidate the cached target (RFC 9111 §4.4)

1 participant