Skip to content

Bug: FeatureResponse::isOk and redirects #3072

Closed
@MGatner

Description

@MGatner

Describe the bug
Am I missing something obvious? FeatureResponse::isOk looks like this:

		// Only 200 and 300 range status codes
		// are considered valid.
		if ($this->response->getStatusCode() >= 400 || $this->response->getStatusCode() < 200)
		{
			return false;
		}

		// Empty bodies are not considered valid.
		if (empty($this->response->getBody()))
		{
			return false;
		}

... but won't redirects (300 statuses) always have an empty body? Regardless of the always, if you use the standard return redirect()->to(... in a controller and then test it with FeatureTestCase then the resulting assertOk() will fail, which seems like a mistake to me.

CodeIgniter 4 version
develop

Affected module(s)
FeatureResponse

Expected behavior, and steps to reproduce if appropriate
See above

Context

  • OS: Linux
  • Web server: Apache
  • PHP version: 7.3

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

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions