CodeIgniter4 icon indicating copy to clipboard operation
CodeIgniter4 copied to clipboard

fix: Response::download() causes TypeError

Open kenjis opened this issue 3 years ago • 2 comments

Description Fixes #6358

How to Test

<?php

namespace App\Controllers;

class Home extends BaseController
{
    public function index()
    {
        return $this->response->download('some.txt', 'some text', true);
    }
}

Checklist:

  • [x] Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [ ] Unit testing, with >80% coverage
  • [ ] User guide updated
  • [x] Conforms to style guide

kenjis avatar Aug 09 '22 01:08 kenjis

Should RedirectResponse be checked? Also, I think null is an acceptable body for some API responses - we might need to check or cast that.

MGatner avatar Aug 09 '22 10:08 MGatner

Hi, same problem here, just testedkenjis fix and works fine.

nicojmb avatar Aug 09 '22 13:08 nicojmb

Changed the implementation.

kenjis avatar Aug 10 '22 10:08 kenjis

Any ideas how this made it through tests to release?

MGatner avatar Aug 10 '22 10:08 MGatner