Skip to content

Clarify cookie header tests and remove duplicate callback serde test#660

Open
ChristianPavilonis wants to merge 1 commit intomainfrom
testing/test-cleanup
Open

Clarify cookie header tests and remove duplicate callback serde test#660
ChristianPavilonis wants to merge 1 commit intomainfrom
testing/test-cleanup

Conversation

@ChristianPavilonis
Copy link
Copy Markdown
Collaborator

Summary

  • add a focused unit test for the invalid UTF-8 Cookie header path in handle_request_cookies
  • rename the existing malformed-cookie test so it matches the behavior it actually covers
  • remove a redundant callback serde rename test while preserving direct and broader deserialization coverage

Changes

File Change
crates/trusted-server-core/src/cookies.rs Renamed the malformed cookie-string test and added a new invalid UTF-8 cookie-header test using HeaderValue::from_bytes(...) to exercise the real InvalidHeaderValue branch.
crates/trusted-server-core/src/models.rs Removed the duplicate callback serde rename test, keeping the existing focused direct test and broader callback deserialization coverage.

Closes

Closes #454
Closes #456

Test plan

  • cargo test --workspace
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check
  • JS tests: cd crates/js/lib && npx vitest run
  • JS format: cd crates/js/lib && npm run format
  • Docs format: cd docs && npm run format
  • WASM build: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1
  • Manual testing via fastly compute serve
  • Other: Rust-only test cleanup; no production behavior changes expected

Checklist

  • Changes follow CLAUDE.md conventions
  • No unwrap() in production code — use expect("should ...")
  • Uses tracing macros (not println!)
  • New code has tests
  • No secrets or credentials committed

@ChristianPavilonis ChristianPavilonis self-assigned this Apr 24, 2026
@ChristianPavilonis ChristianPavilonis requested review from aram356 and prk-Jr and removed request for prk-Jr April 24, 2026 23:24
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.

Consolidate duplicate callback serde rename tests Add invalid cookie header tests for get_cookie_value

1 participant