You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
Hi, we developed a custom Zend Event Listener for our Apigility application, this listener adds custom HTTP headers using the MvcEvent::EVENT_ROUTE Zend event.
In our response headers we send an Expires: 0 header, this is to prevent bugs with Internet Explorer which seems to cache our payloads if we do not explicitly provide HTTP headers to disable caching.
When we provided the Expires: 0 HTTP header Zend Http fails with the following exception.
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (0) at position 0 (0): Unexpected character in D:\workspace\vgm-web-services\vendor\zendframework\zend-http\src\Header\AbstractDate.php:167 Stack trace:
#0 D:\workspace\vgm-web-services\vendor\zendframework\zend-http\src\Header\AbstractDate.php(167): DateTime->__construct('0', Object(DateTimeZone))
#1 D:\workspace\vgm-web-services\vendor\zendframework\zend-http\src\Header\AbstractDate.php(86): Zend\Http\Header\AbstractDate->setDate('0')
#2 D:\workspace\vgm-web-services\vendor\zendframework\zend-http\src\Headers.php(448): Zend\Http\Header\AbstractDate::fromString('Expires: 0')
#3 D:\workspace\vgm-web-services\vendor\zendframework\zend-http\src\Headers.php(352): Zend\Http\Headers->lazyLoadHeader(8)
#4 D:\workspace\vgm-web-services\vendor\zendframework\zend-mvc\src\ResponseSender\AbstractResponseSender.php(30): Zend\Http\Headers->current()
#5 D:\workspace\vgm-web-services\vendor\zendframework\zend-mvc\src\ResponseSender\PhpEnvironmentRespon in D:\workspace\vgm-web-services\vendor\zendframework\zend-http\src\Header\AbstractDate.php on line 169
As you can see the problem comes from the following instruction.
Hi, we developed a custom Zend Event Listener for our Apigility application, this listener adds custom HTTP headers using the
MvcEvent::EVENT_ROUTE
Zend event.In our response headers we send an
Expires: 0
header, this is to prevent bugs with Internet Explorer which seems to cache our payloads if we do not explicitly provide HTTP headers to disable caching.When we provided the
Expires: 0
HTTP header Zend Http fails with the following exception.As you can see the problem comes from the following instruction.
IMO this behavior is not normal because as explained in the RFC https://tools.ietf.org/html/rfc2616#section-14.21 values which are not compliant with the date format must be treated.
So I think Zend should consider that invalid dates are equivalent to
Thu, 01 Jan 1970 00:00:00 GMT
.Do your agree with that ?
Perhaps this issue is also linked to #9.
Thanks
The text was updated successfully, but these errors were encountered: