<?php

namespace App\Framework\Http\Responses;

use App\Framework\Http\HeaderKey;
use App\Framework\Http\Headers;
use App\Framework\Http\Response;
use App\Framework\Http\Status;
use App\Framework\Http\Uri;

final readonly class RedirectResponse implements Response
{
    public Headers $headers;
    public string $body;
    public Status $status;

    public function __construct(
        public Uri $location = new Uri('/'),
    ) {
        $this->status = Status::FOUND;
        $this->body = '';
        $this->headers = new Headers()->with(HeaderKey::LOCATION, (string)$this->location);
    }
}
