66f380340988294889b52ce84cc39b4a1de94390
[yaffs-website] / vendor / zendframework / zend-diactoros / CHANGELOG.md
1 # Changelog
2
3 All notable changes to this project will be documented in this file, in reverse chronological order by release.
4
5 ## 1.7.1 - 2018-02-26
6
7 ### Added
8
9 - Nothing.
10
11 ### Changed
12
13 - [#293](https://github.com/zendframework/zend-diactoros/pull/293) updates
14   `Uri::getHost()` to cast the value via `strtolower()` before returning it.
15   While this represents a change, it is fixing a bug in our implementation: 
16   the PSR-7 specification for the method, which follows IETF RFC 3986 section
17   3.2.2, requires that the host name be normalized to lowercase.
18
19 ### Deprecated
20
21 - Nothing.
22
23 ### Removed
24
25 - Nothing.
26
27 ### Fixed
28
29 - [#290](https://github.com/zendframework/zend-diactoros/pull/290) fixes
30   `Stream::getSize()` such that it checks that the result of `fstat` was
31   succesful before attempting to return its `size` member; in the case of an
32   error, it now returns `null`.
33
34 ## 1.7.0 - 2018-01-04
35
36 ### Added
37
38 - [#285](https://github.com/zendframework/zend-diactoros/pull/285) adds a new
39   custom response type, `Zend\Diactoros\Response\XmlResponse`, for generating
40   responses representing XML. Usage is the same as with the `HtmlResponse` or
41   `TextResponse`; the response generated will have a `Content-Type:
42   application/xml` header by default.
43
44 - [#280](https://github.com/zendframework/zend-diactoros/pull/280) adds the
45   response status code/phrase pairing "103 Early Hints" to the
46   `Response::$phrases` property. This is a new status proposed via
47   [RFC 8297](https://datatracker.ietf.org/doc/rfc8297/).
48
49 - [#279](https://github.com/zendframework/zend-diactoros/pull/279) adds explicit
50   support for PHP 7.2; previously, we'd allowed build failures, though none
51   occured; we now require PHP 7.2 builds to pass.
52
53 ### Changed
54
55 - Nothing.
56
57 ### Deprecated
58
59 - Nothing.
60
61 ### Removed
62
63 - Nothing.
64
65 ### Fixed
66
67 - Nothing.
68
69 ## 1.6.1 - 2017-10-12
70
71 ### Added
72
73 - Nothing.
74
75 ### Changed
76
77 - [#273](https://github.com/zendframework/zend-diactoros/pull/273) updates each
78   of the SAPI emitter implementations to emit the status line after emitting
79   other headers; this is done to ensure that the status line is not overridden
80   by PHP.
81
82 ### Deprecated
83
84 - Nothing.
85
86 ### Removed
87
88 - Nothing.
89
90 ### Fixed
91
92 - [#273](https://github.com/zendframework/zend-diactoros/pull/273) modifies how
93   the `SapiEmitterTrait` calls `header()` to ensure that a response code is
94   _always_ passed as the third argument; this is done to prevent PHP from
95   silently overriding it.
96
97 ## 1.6.0 - 2017-09-13
98
99 ### Added
100
101 - Nothing.
102
103 ### Changed
104
105 - [#270](https://github.com/zendframework/zend-diactoros/pull/270) changes the
106   behavior of `Zend\Diactoros\Server`: it no longer creates an output buffer.
107
108 - [#270](https://github.com/zendframework/zend-diactoros/pull/270) changes the
109   behavior of the two SAPI emitters in two backwards-incompatible ways:
110
111   - They no longer auto-inject a `Content-Length` header. If you need this
112     functionality, zendframework/zend-expressive-helpers 4.1+ provides it via
113     `Zend\Expressive\Helper\ContentLengthMiddleware`.
114
115   - They no longer flush the output buffer. Instead, if headers have been sent,
116     or the output buffer exists and has a non-zero length, the emitters raise an
117     exception, as mixed PSR-7/output buffer content creates a blocking issue.
118     If you are emitting content via `echo`, `print`, `var_dump`, etc., or not
119     catching PHP errors or exceptions, you will need to either fix your
120     application to always work with a PSR-7 response, or provide your own
121     emitters that allow mixed output mechanisms.
122
123 ### Deprecated
124
125 - Nothing.
126
127 ### Removed
128
129 - Nothing.
130
131 ### Fixed
132
133 - Nothing.
134
135 ## 1.5.0 - 2017-08-22
136
137 ### Added
138
139 - [#205](https://github.com/zendframework/zend-diactoros/pull/205) adds support
140   for PHP 7.2.
141
142 - [#250](https://github.com/zendframework/zend-diactoros/pull/250) adds a new
143   API to `JsonResponse` to avoid the need for decoding the response body in
144   order to make changes to the underlying content. New methods include:
145   - `getPayload()`: retrieve the unencoded payload.
146   - `withPayload($data)`: create a new instance with the given data.
147   - `getEncodingOptions()`: retrieve the flags to use when encoding the payload
148     to JSON.
149   - `withEncodingOptions(int $encodingOptions)`: create a new instance that uses
150     the provided flags when encoding the payload to JSON.
151
152 ### Changed
153
154 - [#249](https://github.com/zendframework/zend-diactoros/pull/249) changes the
155   behavior of the various `Uri::with*()` methods slightly: if the value
156   represents no change, these methods will return the same instance instead of a
157   new one.
158
159 - [#248](https://github.com/zendframework/zend-diactoros/pull/248) changes the
160   behavior of `Uri::getUserInfo()` slightly: it now (correctly) returns the
161   percent-encoded values for the user and/or password, per RFC 3986 Section
162   3.2.1. `withUserInfo()` will percent-encode values, using a mechanism that
163   prevents double-encoding.
164
165 - [#243](https://github.com/zendframework/zend-diactoros/pull/243) changes the
166   exception messages thrown by `UploadedFile::getStream()` and `moveTo()` when
167   an upload error exists to include details about the upload error.
168
169 - [#233](https://github.com/zendframework/zend-diactoros/pull/233) adds a new
170   argument to `SapiStreamEmitter::emit`, `$maxBufferLevel` **between** the
171   `$response` and `$maxBufferLength` arguments. This was done because the
172   `Server::listen()` method passes only the response and `$maxBufferLevel` to
173   emitters; previously, this often meant that streams were being chunked 2 bytes
174   at a time versus the expected default of 8kb.
175
176   If you were calling the `SapiStreamEmitter::emit()` method manually
177   previously, you will need to update your code.
178
179 ### Deprecated
180
181 - Nothing.
182
183 ### Removed
184
185 - [#205](https://github.com/zendframework/zend-diactoros/pull/205) and
186   [#243](https://github.com/zendframework/zend-diactoros/pull/243) **remove
187   support for PHP versions prior to 5.6 as well as HHVM**.
188
189 ### Fixed
190
191 - [#248](https://github.com/zendframework/zend-diactoros/pull/248) fixes how the
192   `Uri` class provides user-info within the URI authority; the value is now
193   correctly percent-encoded , per RFC 3986 Section 3.2.1.
194
195 ## 1.4.1 - 2017-08-17
196
197 ### Added
198
199 - Nothing.
200
201 ### Deprecated
202
203 - Nothing.
204
205 ### Removed
206
207 - [#260](https://github.com/zendframework/zend-diactoros/pull/260) removes
208   support for HHVM, as tests have failed against it for some time.
209
210 ### Fixed
211
212 - [#247](https://github.com/zendframework/zend-diactoros/pull/247) fixes the
213   `Stream` and `RelativeStream` `__toString()` method implementations to check
214   if the stream `isSeekable()` before attempting to `rewind()` it, ensuring that
215   the method does not raise exceptions (PHP does not allow exceptions in that
216   method). In particular, this fixes an issue when using AWS S3 streams.
217
218 - [#252](https://github.com/zendframework/zend-diactoros/pull/252) provides a
219   fix to the `SapiEmitterTrait` to ensure that any `Set-Cookie` headers in the
220   response instance do not override those set by PHP when a session is created
221   and/or regenerated.
222
223 - [#257](https://github.com/zendframework/zend-diactoros/pull/257) provides a
224   fix for the `PhpInputStream::read()` method to ensure string content that
225   evaluates as empty (including `0`) is still cached.
226
227 - [#258](https://github.com/zendframework/zend-diactoros/pull/258) updates the
228   `Uri::filterPath()` method to allow parens within a URI path, per [RFC 3986
229   section 3.3](https://tools.ietf.org/html/rfc3986#section-3.3) (parens are
230   within the character set "sub-delims").
231
232 ## 1.4.0 - 2017-04-06
233
234 ### Added
235
236 - [#219](https://github.com/zendframework/zend-diactoros/pull/219) adds two new
237   classes, `Zend\Diactoros\Request\ArraySerializer` and
238   `Zend\Diactoros\Response\ArraySerializer`. Each exposes the static methods
239   `toArray()` and `fromArray()`, allowing de/serialization of messages from and
240   to arrays.
241
242 - [#236](https://github.com/zendframework/zend-diactoros/pull/236) adds two new
243   constants to the `Response` class: `MIN_STATUS_CODE_VALUE` and
244   `MAX_STATUS_CODE_VALUE`.
245
246 ### Changes
247
248 - [#240](https://github.com/zendframework/zend-diactoros/pull/240) changes the
249   behavior of `ServerRequestFactory::fromGlobals()` when no `$cookies` argument
250   is present. Previously, it would use `$_COOKIES`; now, if a `Cookie` header is
251   present, it will parse and use that to populate the instance instead.
252
253   This change allows utilizing cookies that contain period characters (`.`) in
254   their names (PHP's built-in cookie handling renames these to replace `.` with
255   `_`, which can lead to synchronization issues with clients).
256
257 - [#235](https://github.com/zendframework/zend-diactoros/pull/235) changes the
258   behavior of `Uri::__toString()` to better follow proscribed behavior in PSR-7.
259   In particular, prior to this release, if a scheme was missing but an authority
260   was present, the class was incorrectly returning a value that did not include
261   a `//` prefix. As of this release, it now does this correctly.
262
263 ### Deprecated
264
265 - Nothing.
266
267 ### Removed
268
269 - Nothing.
270
271 ### Fixed
272
273 - Nothing.
274
275 ## 1.3.11 - 2017-04-06
276
277 ### Added
278
279 - Nothing.
280
281 ### Changes
282
283 - [#241](https://github.com/zendframework/zend-diactoros/pull/241) changes the
284   constraint by which the package provides `psr/http-message-implementation` to
285   simply `1.0` instead of `~1.0.0`, to follow how other implementations provide
286   PSR-7.
287
288 ### Deprecated
289
290 - Nothing.
291
292 ### Removed
293
294 - Nothing.
295
296 ### Fixed
297
298 - [#161](https://github.com/zendframework/zend-diactoros/pull/161) adds
299   additional validations to header names and values to ensure no malformed values
300   are provided.
301
302 - [#234](https://github.com/zendframework/zend-diactoros/pull/234) fixes a
303   number of reason phrases in the `Response` instance, and adds automation from
304   the canonical IANA sources to ensure any new phrases added are correct.
305
306 ## 1.3.10 - 2017-01-23
307
308 ### Added
309
310 - Nothing.
311
312 ### Deprecated
313
314 - Nothing.
315
316 ### Removed
317
318 - Nothing.
319
320 ### Fixed
321
322 - [#226](https://github.com/zendframework/zend-diactoros/pull/226) fixed an
323   issue with the `SapiStreamEmitter` causing the response body to be cast
324   to `(string)` and also be read as a readable stream, potentially producing
325   double output.
326
327 ## 1.3.9 - 2017-01-17
328
329 ### Added
330
331 - Nothing.
332
333 ### Deprecated
334
335 - Nothing.
336
337 ### Removed
338
339 - Nothing.
340
341 ### Fixed
342
343 - [#223](https://github.com/zendframework/zend-diactoros/issues/223)
344   [#224](https://github.com/zendframework/zend-diactoros/pull/224) fixed an issue
345   with the `SapiStreamEmitter` consuming too much memory when producing output
346   for readable bodies.
347
348 ## 1.3.8 - 2017-01-05
349
350 ### Added
351
352 - Nothing.
353
354 ### Deprecated
355
356 - Nothing.
357
358 ### Removed
359
360 - Nothing.
361
362 ### Fixed
363
364 - [#222](https://github.com/zendframework/zend-diactoros/pull/222) fixes the
365   `SapiStreamEmitter`'s handling of the `Content-Range` header to properly only
366   emit a range of bytes if the header value is in the form `bytes {first-last}/length`.
367   This allows using other range units, such as `items`, without incorrectly
368   emitting truncated content.
369
370 ## 1.3.7 - 2016-10-11
371
372 ### Added
373
374 - [#208](https://github.com/zendframework/zend-diactoros/pull/208) adds several
375   missing response codes to `Zend\Diactoros\Response`, including:
376   - 226 ('IM used')
377   - 308 ('Permanent Redirect')
378   - 444 ('Connection Closed Without Response')
379   - 499 ('Client Closed Request')
380   - 510 ('Not Extended')
381   - 599 ('Network Connect Timeout Error')
382 - [#211](https://github.com/zendframework/zend-diactoros/pull/211) adds support
383   for UTF-8 characters in query strings handled by `Zend\Diactoros\Uri`.
384
385 ### Deprecated
386
387 - Nothing.
388
389 ### Removed
390
391 - Nothing.
392
393 ### Fixed
394
395 - Nothing.
396
397 ## 1.3.6 - 2016-09-07
398
399 ### Added
400
401 - [#170](https://github.com/zendframework/zend-diactoros/pull/170) prepared
402   documentation for publication at https://zendframework.github.io/zend-diactoros/
403 - [#165](https://github.com/zendframework/zend-diactoros/pull/165) adds support
404   for Apache `REDIRECT_HTTP_*` header detection in the `ServerRequestFactory`.
405 - [#166](https://github.com/zendframework/zend-diactoros/pull/166) adds support
406   for UTF-8 characters in URI paths.
407 - [#204](https://github.com/zendframework/zend-diactoros/pull/204) adds testing
408   against PHP 7.1 release-candidate builds.
409
410 ### Deprecated
411
412 - Nothing.
413
414 ### Removed
415
416 - Nothing.
417
418 ### Fixed
419
420 - [#186](https://github.com/zendframework/zend-diactoros/pull/186) fixes a typo
421   in a variable name within the `SapiStreamEmitter`.
422 - [#200](https://github.com/zendframework/zend-diactoros/pull/200) updates the
423   `SapiStreamEmitter` to implement a check for `isSeekable()` prior to attempts
424   to rewind; this allows it to work with non-seekable streams such as the
425   `CallbackStream`.
426 - [#169](https://github.com/zendframework/zend-diactoros/pull/169) ensures that
427   response serialization always provides a `\r\n\r\n` sequence following the
428   headers, even when no message body is present, to ensure it conforms with RFC
429   7230.
430 - [#175](https://github.com/zendframework/zend-diactoros/pull/175) updates the
431   `Request` class to set the `Host` header from the URI host if no header is
432   already present. (Ensures conformity with PSR-7 specification.)
433 - [#197](https://github.com/zendframework/zend-diactoros/pull/197) updates the
434   `Uri` class to ensure that string serialization does not include a colon after
435   the host name if no port is present in the instance.
436
437 ## 1.3.5 - 2016-03-17
438
439 ### Added
440
441 - Nothing.
442
443 ### Deprecated
444
445 - Nothing.
446
447 ### Removed
448
449 - Nothing.
450
451 ### Fixed
452
453 - [#160](https://github.com/zendframework/zend-diactoros/pull/160) fixes HTTP
454   protocol detection in the `ServerRequestFactory` to work correctly with HTTP/2.
455
456 ## 1.3.4 - 2016-03-17
457
458 ### Added
459
460 - [#119](https://github.com/zendframework/zend-diactoros/pull/119) adds the 451
461   (Unavailable for Legal Reasons) status code to the `Response` class.
462
463 ### Deprecated
464
465 - Nothing.
466
467 ### Removed
468
469 - Nothing.
470
471 ### Fixed
472
473 - [#117](https://github.com/zendframework/zend-diactoros/pull/117) provides
474   validation of the HTTP protocol version.
475 - [#127](https://github.com/zendframework/zend-diactoros/pull/127) now properly
476   removes attributes with `null` values when calling `withoutAttribute()`.
477 - [#132](https://github.com/zendframework/zend-diactoros/pull/132) updates the
478   `ServerRequestFactory` to marshal the request path fragment, if present.
479 - [#142](https://github.com/zendframework/zend-diactoros/pull/142) updates the
480   exceptions thrown by `HeaderSecurity` to include the header name and/or
481   value.
482 - [#148](https://github.com/zendframework/zend-diactoros/pull/148) fixes several
483   stream operations to ensure they raise exceptions when the internal pointer
484   is at an invalid position.
485 - [#151](https://github.com/zendframework/zend-diactoros/pull/151) ensures
486   URI fragments are properly encoded.
487
488 ## 1.3.3 - 2016-01-04
489
490 ### Added
491
492 - Nothing.
493
494 ### Deprecated
495
496 - Nothing.
497
498 ### Removed
499
500 - Nothing.
501
502 ### Fixed
503
504 - [#135](https://github.com/zendframework/zend-diactoros/pull/135) fixes the
505   behavior of `ServerRequestFactory::marshalHeaders()` to no longer omit
506   `Cookie` headers from the aggregated headers. While the values are parsed and
507   injected into the cookie params, it's useful to have access to the raw headers
508   as well.
509
510 ## 1.3.2 - 2015-12-22
511
512 ### Added
513
514 - [#124](https://github.com/zendframework/zend-diactoros/pull/124) adds four
515   more optional arguments to the `ServerRequest` constructor:
516   - `array $cookies`
517   - `array $queryParams`
518   - `null|array|object $parsedBody`
519   - `string $protocolVersion`
520   `ServerRequestFactory` was updated to pass values for each of these parameters
521   when creating an instance, instead of using the related `with*()` methods on
522   an instance.
523
524 ### Deprecated
525
526 - Nothing.
527
528 ### Removed
529
530 - Nothing.
531
532 ### Fixed
533
534 - [#122](https://github.com/zendframework/zend-diactoros/pull/122) updates the
535   `ServerRequestFactory` to retrieve the HTTP protocol version and inject it in
536   the generated `ServerRequest`, which previously was not performed.
537
538 ## 1.3.1 - 2015-12-16
539
540 ### Added
541
542 - Nothing.
543
544 ### Deprecated
545
546 - Nothing.
547
548 ### Removed
549
550 - Nothing.
551
552 ### Fixed
553
554 - [#113](https://github.com/zendframework/zend-diactoros/pull/113) fixes an
555   issue in the response serializer, ensuring that the status code in the
556   deserialized response is an integer.
557 - [#115](https://github.com/zendframework/zend-diactoros/pull/115) fixes an
558   issue in the various text-basd response types (`TextResponse`, `HtmlResponse`,
559   and `JsonResponse`); due to the fact that the constructor was not
560   rewinding the message body stream, `getContents()` was thus returning `null`,
561   as the pointer was at the end of the stream. The constructor now rewinds the
562   stream after populating it in the constructor.
563
564 ## 1.3.0 - 2015-12-15
565
566 ### Added
567
568 - [#110](https://github.com/zendframework/zend-diactoros/pull/110) adds
569   `Zend\Diactoros\Response\SapiEmitterTrait`, which provides the following
570   private method definitions:
571   - `injectContentLength()`
572   - `emitStatusLine()`
573   - `emitHeaders()`
574   - `flush()`
575   - `filterHeader()`
576   The `SapiEmitter` implementation has been updated to remove those methods and
577   instead compose the trait.
578 - [#111](https://github.com/zendframework/zend-diactoros/pull/111) adds
579   a new emitter implementation, `SapiStreamEmitter`; this emitter type will
580   loop through the stream instead of emitting it in one go, and supports content
581   ranges.
582
583 ### Deprecated
584
585 - Nothing.
586
587 ### Removed
588
589 - Nothing.
590
591 ### Fixed
592
593 - Nothing.
594
595 ## 1.2.1 - 2015-12-15
596
597 ### Added
598
599 - Nothing.
600
601 ### Deprecated
602
603 - Nothing.
604
605 ### Removed
606
607 - Nothing.
608
609 ### Fixed
610
611 - [#101](https://github.com/zendframework/zend-diactoros/pull/101) fixes the
612   `withHeader()` implementation to ensure that if the header existed previously
613   but using a different casing strategy, the previous version will be removed
614   in the cloned instance.
615 - [#103](https://github.com/zendframework/zend-diactoros/pull/103) fixes the
616   constructor of `Response` to ensure that null status codes are not possible.
617 - [#99](https://github.com/zendframework/zend-diactoros/pull/99) fixes
618   validation of header values submitted via request and response constructors as
619   follows:
620   - numeric (integer and float) values are now properly allowed (this solves
621     some reported issues with setting Content-Length headers)
622   - invalid header names (non-string values or empty strings) now raise an
623     exception.
624   - invalid individual header values (non-string, non-numeric) now raise an
625     exception.
626
627 ## 1.2.0 - 2015-11-24
628
629 ### Added
630
631 - [#88](https://github.com/zendframework/zend-diactoros/pull/88) updates the
632   `SapiEmitter` to emit a `Content-Length` header with the content length as
633   reported by the response body stream, assuming that
634   `StreamInterface::getSize()` returns an integer.
635 - [#77](https://github.com/zendframework/zend-diactoros/pull/77) adds a new
636   response type, `Zend\Diactoros\Response\TextResponse`, for returning plain
637   text responses. By default, it sets the content type to `text/plain;
638   charset=utf-8`; per the other response types, the signature is `new
639   TextResponse($text, $status = 200, array $headers = [])`.
640 - [#90](https://github.com/zendframework/zend-diactoros/pull/90) adds a new
641   `Zend\Diactoros\CallbackStream`, allowing you to back a stream with a PHP
642   callable (such as a generator) to generate the message content. Its
643   constructor accepts the callable: `$stream = new CallbackStream($callable);`
644
645 ### Deprecated
646
647 - Nothing.
648
649 ### Removed
650
651 - Nothing.
652
653 ### Fixed
654
655 - [#77](https://github.com/zendframework/zend-diactoros/pull/77) updates the
656   `HtmlResponse` to set the charset to utf-8 by default (if no content type
657   header is provided at instantiation).
658
659 ## 1.1.4 - 2015-10-16
660
661 ### Added
662
663 - [#98](https://github.com/zendframework/zend-diactoros/pull/98) adds
664   `JSON_UNESCAPED_SLASHES` to the default `json_encode` flags used by
665   `Zend\Diactoros\Response\JsonResponse`.
666
667 ### Deprecated
668
669 - Nothing.
670
671 ### Removed
672
673 - Nothing.
674
675 ### Fixed
676
677 - [#96](https://github.com/zendframework/zend-diactoros/pull/96) updates
678   `withPort()` to allow `null` port values (indicating usage of default for
679   the given scheme).
680 - [#91](https://github.com/zendframework/zend-diactoros/pull/91) fixes the
681   logic of `withUri()` to do a case-insensitive check for an existing `Host`
682   header, replacing it with the new one.
683
684 ## 1.1.3 - 2015-08-10
685
686 ### Added
687
688 - [#73](https://github.com/zendframework/zend-diactoros/pull/73) adds caching of
689   the vendor directory to the Travis-CI configuration, to speed up builds.
690
691 ### Deprecated
692
693 - Nothing.
694
695 ### Removed
696
697 - Nothing.
698
699 ### Fixed
700
701 - [#71](https://github.com/zendframework/zend-diactoros/pull/71) fixes the
702   docblock of the `JsonResponse` constructor to typehint the `$data` argument
703   as `mixed`.
704 - [#73](https://github.com/zendframework/zend-diactoros/pull/73) changes the
705   behavior in `Request` such that if it marshals a stream during instantiation,
706   the stream is marked as writeable (specifically, mode `wb+`).
707 - [#85](https://github.com/zendframework/zend-diactoros/pull/85) updates the
708   behavior of `Zend\Diactoros\Uri`'s various `with*()` methods that are
709   documented as accepting strings to raise exceptions on non-string input.
710   Previously, several simply passed non-string input on verbatim, others
711   normalized the input, and a few correctly raised the exceptions. Behavior is
712   now consistent across each.
713 - [#87](https://github.com/zendframework/zend-diactoros/pull/87) fixes
714   `UploadedFile` to ensure that `moveTo()` works correctly in non-SAPI
715   environments when the file provided to the constructor is a path.
716
717 ## 1.1.2 - 2015-07-12
718
719 ### Added
720
721 - Nothing.
722
723 ### Deprecated
724
725 - Nothing.
726
727 ### Removed
728
729 - Nothing.
730
731 ### Fixed
732
733 - [#67](https://github.com/zendframework/zend-diactoros/pull/67) ensures that
734   the `Stream` class only accepts `stream` resources, not any resource.
735
736 ## 1.1.1 - 2015-06-25
737
738 ### Added
739
740 - Nothing.
741
742 ### Deprecated
743
744 - Nothing.
745
746 ### Removed
747
748 - Nothing.
749
750 ### Fixed
751
752 - [#64](https://github.com/zendframework/zend-diactoros/pull/64) fixes the
753   behavior of `JsonResponse` with regards to serialization of `null` and scalar
754   values; the new behavior is to serialize them verbatim, without any casting.
755
756 ## 1.1.0 - 2015-06-24
757
758 ### Added
759
760 - [#52](https://github.com/zendframework/zend-diactoros/pull/52),
761   [#58](https://github.com/zendframework/zend-diactoros/pull/58),
762   [#59](https://github.com/zendframework/zend-diactoros/pull/59), and
763   [#61](https://github.com/zendframework/zend-diactoros/pull/61) create several
764   custom response types for simplifying response creation:
765
766   - `Zend\Diactoros\Response\HtmlResponse` accepts HTML content via its
767     constructor, and sets the `Content-Type` to `text/html`.
768   - `Zend\Diactoros\Response\JsonResponse` accepts data to serialize to JSON via
769     its constructor, and sets the `Content-Type` to `application/json`.
770   - `Zend\Diactoros\Response\EmptyResponse` allows creating empty, read-only
771     responses, with a default status code of 204.
772   - `Zend\Diactoros\Response\RedirectResponse` allows specifying a URI for the
773     `Location` header in the constructor, with a default status code of 302.
774
775   Each also accepts an optional status code, and optional headers (which can
776   also be used to provide an alternate `Content-Type` in the case of the HTML
777   and JSON responses).
778
779 ### Deprecated
780
781 - Nothing.
782
783 ### Removed
784
785 - [#43](https://github.com/zendframework/zend-diactoros/pull/43) removed both
786   `ServerRequestFactory::marshalUri()` and `ServerRequestFactory::marshalHostAndPort()`,
787   which were deprecated prior to the 1.0 release.
788
789 ### Fixed
790
791 - [#29](https://github.com/zendframework/zend-diactoros/pull/29) fixes request
792   method validation to allow any valid token as defined by [RFC
793   7230](http://tools.ietf.org/html/rfc7230#appendix-B). This allows usage of
794   custom request methods, vs a static, hard-coded list.
795
796 ## 1.0.5 - 2015-06-24
797
798 ### Added
799
800 - Nothing.
801
802 ### Deprecated
803
804 - Nothing.
805
806 ### Removed
807
808 - Nothing.
809
810 ### Fixed
811
812 - [#60](https://github.com/zendframework/zend-diactoros/pull/60) fixes
813   the behavior of `UploadedFile` when the `$errorStatus` provided at
814   instantiation is not `UPLOAD_ERR_OK`. Prior to the fix, an
815   `InvalidArgumentException` would occur at instantiation due to the fact that
816   the upload file was missing or invalid. With the fix, no exception is raised
817   until a call to `moveTo()` or `getStream()` is made.
818
819 ## 1.0.4 - 2015-06-23
820
821 This is a security release.
822
823 A patch has been applied to `Zend\Diactoros\Uri::filterPath()` that ensures that
824 paths can only begin with a single leading slash. This prevents the following
825 potential security issues:
826
827 - XSS vectors. If the URI path is used for links or form targets, this prevents
828   cases where the first segment of the path resembles a domain name, thus
829   creating scheme-relative links such as `//example.com/foo`. With the patch,
830   the leading double slash is reduced to a single slash, preventing the XSS
831   vector.
832 - Open redirects. If the URI path is used for `Location` or `Link` headers,
833   without a scheme and authority, potential for open redirects exist if clients
834   do not prepend the scheme and authority. Again, preventing a double slash
835   corrects the vector.
836
837 If you are using `Zend\Diactoros\Uri` for creating links, form targets, or
838 redirect paths, and only using the path segment, we recommend upgrading
839 immediately.
840
841 ### Added
842
843 - [#25](https://github.com/zendframework/zend-diactoros/pull/25) adds
844   documentation. Documentation is written in markdown, and can be converted to
845   HTML using [bookdown](http://bookdown.io). New features now MUST include
846   documentation for acceptance.
847
848 ### Deprecated
849
850 - Nothing.
851
852 ### Removed
853
854 - Nothing.
855
856 ### Fixed
857
858 - [#51](https://github.com/zendframework/zend-diactoros/pull/51) fixes
859   `MessageTrait::getHeaderLine()` to return an empty string instead of `null` if
860   the header is undefined (which is the behavior specified in PSR-7).
861 - [#57](https://github.com/zendframework/zend-diactoros/pull/57) fixes the
862   behavior of how the `ServerRequestFactory` marshals upload files when they are
863   represented as a nested associative array.
864 - [#49](https://github.com/zendframework/zend-diactoros/pull/49) provides several
865   fixes that ensure that Diactoros complies with the PSR-7 specification:
866   - `MessageInterface::getHeaderLine()` MUST return a string (that string CAN be
867     empty). Previously, Diactoros would return `null`.
868   - If no `Host` header is set, the `$preserveHost` flag MUST be ignored when
869     calling `withUri()` (previously, Diactoros would not set the `Host` header
870     if `$preserveHost` was `true`, but no `Host` header was present).
871   - The request method MUST be a string; it CAN be empty. Previously, Diactoros
872     would return `null`.
873   - The request MUST return a `UriInterface` instance from `getUri()`; that
874     instance CAN be empty. Previously, Diactoros would return `null`; now it
875     lazy-instantiates an empty `Uri` instance on initialization.
876 - [ZF2015-05](http://framework.zend.com/security/advisory/ZF2015-05) was
877   addressed by altering `Uri::filterPath()` to prevent emitting a path prepended
878   with multiple slashes.
879
880 ## 1.0.3 - 2015-06-04
881
882 ### Added
883
884 - [#48](https://github.com/zendframework/zend-diactoros/pull/48) drops the
885   minimum supported PHP version to 5.4, to allow an easier upgrade path for
886   Symfony 2.7 users, and potential Drupal 8 usage.
887
888 ### Deprecated
889
890 - Nothing.
891
892 ### Removed
893
894 - Nothing.
895
896 ### Fixed
897
898 - Nothing.
899
900 ## 1.0.2 - 2015-06-04
901
902 ### Added
903
904 - [#27](https://github.com/zendframework/zend-diactoros/pull/27) adds phonetic
905   pronunciation of "Diactoros" to the README file.
906 - [#36](https://github.com/zendframework/zend-diactoros/pull/36) adds property
907   annotations to the class-level docblock of `Zend\Diactoros\RequestTrait` to
908   ensure properties inherited from the `MessageTrait` are inherited by
909   implementations.
910
911 ### Deprecated
912
913 - Nothing.
914
915 ### Removed
916
917 - Nothing.
918 -
919 ### Fixed
920
921 - [#41](https://github.com/zendframework/zend-diactoros/pull/41) fixes the
922   namespace for test files to begin with `ZendTest` instead of `Zend`.
923 - [#46](https://github.com/zendframework/zend-diactoros/pull/46) ensures that
924   the cookie and query params for the `ServerRequest` implementation are
925   initialized as arrays.
926 - [#47](https://github.com/zendframework/zend-diactoros/pull/47) modifies the
927   internal logic in `HeaderSecurity::isValid()` to use a regular expression
928   instead of character-by-character comparisons, improving performance.
929
930 ## 1.0.1 - 2015-05-26
931
932 ### Added
933
934 - [#10](https://github.com/zendframework/zend-diactoros/pull/10) adds
935   `Zend\Diactoros\RelativeStream`, which will return stream contents relative to
936   a given offset (i.e., a subset of the stream).  `AbstractSerializer` was
937   updated to create a `RelativeStream` when creating the body of a message,
938   which will prevent duplication of the stream in-memory.
939 - [#21](https://github.com/zendframework/zend-diactoros/pull/21) adds a
940   `.gitattributes` file that excludes directories and files not needed for
941   production; this will further minify the package for production use cases.
942
943 ### Deprecated
944
945 - Nothing.
946
947 ### Removed
948
949 - Nothing.
950
951 ### Fixed
952
953 - [#9](https://github.com/zendframework/zend-diactoros/pull/9) ensures that
954   attributes are initialized to an empty array, ensuring that attempts to
955   retrieve single attributes when none are defined will not produce errors.
956 - [#14](https://github.com/zendframework/zend-diactoros/pull/14) updates
957   `Zend\Diactoros\Request` to use a `php://temp` stream by default instead of
958   `php://memory`, to ensure requests do not create an out-of-memory condition.
959 - [#15](https://github.com/zendframework/zend-diactoros/pull/15) updates
960   `Zend\Diactoros\Stream` to ensure that write operations trigger an exception
961   if the stream is not writeable. Additionally, it adds more robust logic for
962   determining if a stream is writeable.
963
964 ## 1.0.0 - 2015-05-21
965
966 First stable release, and first release as `zend-diactoros`.
967
968 ### Added
969
970 - Nothing.
971
972 ### Deprecated
973
974 - Nothing.
975
976 ### Removed
977
978 - Nothing.
979
980 ### Fixed
981
982 - Nothing.