zend-diactoros icon indicating copy to clipboard operation
zend-diactoros copied to clipboard

Empty header check breaking change

Open soundsgoodsofar opened this issue 5 years ago • 4 comments

The following commit causes breaking issues and probably should not have been implemented in a minor version.

https://github.com/zendframework/zend-diactoros/commit/ee4bcdc43b6d60cd2b1256809903b8620a7257c7#diff-5abca4d9d5693da46d10a54795b1192d

Specifically this change breaks laravel/passport ^3.0 which depends on ~1.0 of this library.

I've opened a ticket for them to patch branch 3.x, but that patch may introduce new problems. That's why I'd suggest this update be reverted from 1.x of the zend framework.

soundsgoodsofar avatar Mar 19 '19 19:03 soundsgoodsofar

This is problematic to back out of the 1.8 series of zend-diactoros.

The patch that introduced it, #325, did so in order to make the library comply correctly with the PSR-7 specification. Essentially, by not checking it, we had introduced a bug in our implementation.

That also means that, on the flip side, if you were relying on that behavior previously, you were relying on a bug.

If laravel/passport requires the original behavior, one solution is to do the following in your composer.json:

"require": {
    "zendframework/zend-diactoros": "~1.0"
},
"conflict": {
    "zendframework/zend-diactoros": "1.8.6"
}

Pinging @Ocramius — thoughts on reverting #325 for the 1.8 series?

weierophinney avatar Mar 19 '19 19:03 weierophinney

Hey everyone. Seems that the problem lies with Symfony HttpFoundation's ServerBag class and not with Passport itself. See https://github.com/laravel/passport/issues/992

driesvints avatar Mar 21 '19 08:03 driesvints

My 2 cents on the issue: I wouldn't revert the change if it was a bug fix to comply to PSR-7 more. Implementing libraries were relying on faulty behavior like @weierophinney noted.

driesvints avatar Mar 21 '19 08:03 driesvints

This repository has been closed and moved to laminas/laminas-diactoros; a new issue has been opened at https://github.com/laminas/laminas-diactoros/issues/8.

weierophinney avatar Dec 31 '19 22:12 weierophinney