Skip to content

Web: header() Location redirect (302) for VM, JIT, and AOT #634

Description

@PurHur

Problem

header('Content-Type: …') works in VM/JIT/AOT, but redirect responses (header('Location: /path') + optional http_response_code(302)) are untested and may not emit CGI-correct Status: / Location: ordering.

#68 tracks a PHPT suite; this issue ships the builtin behavior redirect apps need (post-login, trailing-slash canonicalization).

Goal

header('Location: /done');
http_response_code(302);
// or: header('Location: /done', true, 302);

VM + JIT + AOT output includes Status: 302 (or 302 Found) and Location: /done before body (empty body acceptable).

Implementation hints

Layer Files Notes
VM ext/standard/header.php, lib/Web/ response buffer Replace prior headers on redirect; default 302 when Location set
JIT ext/standard/JitHeader.php Mirror VM CGI line format
AOT same as JIT Per-request header list reset (#49)
Tests test/compliance/cases/web/header_redirect_302.phpt VM in ci-fast
Tests test/real/cases/web_redirect_302.phpt tracks #68

Acceptance criteria

./script/ci-fast.sh --filter 'header_redirect|web_redirect'
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
  ./script/ci-local.sh --filter header_redirect

Dependencies

Verification

Local/Docker only.

Links

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions