Review main Abandoned

58637[TASK] Http\Message: Support integers as header-values

Stefan Neufeind CR 0 V 0 Normal +42 −9 updated 10/28/18, 12:45

Commit message

For certain types like Expires-headers it might be handy to
also accept integer-values. When adding those headers they
will be converted to string.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 2

Review log 1115

  1. Stefan Neufeind uploaded patch set 1 10/15/18, 16:00

  2. TYPO3com voted on patch set 1 V -1 10/15/18, 16:00 Completed build in 08s on Mon, 15 Oct, 06:00 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-29456

  3. Oliver Klee commented on patch set 1 10/15/18, 16:07

    Message.php:197

    So this needs to be adapted as well.
  4. Stefan Neufeind uploaded patch set 2 10/15/18, 16:23

  5. TYPO3com voted on patch set 2 V -1 10/15/18, 16:35 Completed build in 11m 32s on Mon, 15 Oct, 06:35 PM Test Summary: 3 of 38167 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-29457

  6. Stefan Neufeind uploaded patch set 3 10/15/18, 16:38

  7. Stefan Neufeind uploaded patch set 4 10/15/18, 16:46

  8. TYPO3com voted on patch set 3 V -1 10/15/18, 16:49 Completed build in 10m 18s on Mon, 15 Oct, 06:49 PM Test Summary: 3 of 38167 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-29458

  9. Oliver Klee commented on patch set 4 10/15/18, 16:59

    Message.php:377

    Is the array recursive? If not, we can cast all values to strings (as casting a string to a string will do no harm).
  10. TYPO3com voted on patch set 4 V +1 10/15/18, 16:59 Completed build in 12m 46s on Mon, 15 Oct, 06:59 PM Test Summary: 37804 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-29459

  11. Stefan Neufeind commented on patch set 4 10/15/18, 17:34

    Message.php:377 Reply

    Originally we checked for "is a string". I'd want to extend that to allow integers as well, but casting "anything" to a string might not really be desired. Even starting with floats would usually give an unexpected result here. Imho let's stick to just int and string.
  12. Benni Mack commented on patch set 4 10/28/18, 11:49

    you know that Http/Message is a PSR-7 implementation that follows a certain "standard" - and that explicitly only allows strings and arrays? https://github.com/php-fig/http-message/blob/master/src/MessageInterface.php#L128
  13. Benni Mack commented on patch set 4 CR -1 10/28/18, 11:49

    I'm 100% against making this change to our PSR-7 implementation, as this would allow to never exchange our implementation in the future.
  14. Susi Moog commented on patch set 4 CR -1 10/28/18, 12:05

    headers (and specifically the expires header) are defined as string (see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html ) - we should not encourage "wrong" values here. especially as the only valid int as far as I can see would be "0"...
  15. Benni Mack abandoned the change 10/28/18, 12:45

    not the proper solution, we fixed the "Expires" header separately already.