-
-
Notifications
You must be signed in to change notification settings - Fork 336
Description
Bug Report
Steps to reproduce
We send data using https://github.com/atk4/ui/blob/5.0.0/src/Form.php#L530 and on webserver we require the Content-Type header to be set correctly even if the data are empty in https://github.com/Nyholm/psr7-server/blob/1.0.2/src/ServerRequestCreator.php#L62
This is how html empty form like <form action="/action_page.php" method="post"><input type="submit"></form> behaves.
Expected result
Content-Type header always sent
ref: https://www.rfc-editor.org/rfc/rfc7231#section-3.1.1.5 - simply said, implicit content-type will almost always be wrong, data of count zero (empty array) must be handled no differently than non-empty data
Actual result
Content-Type: application/x-www-form-urlencoded; charset=UTF-8 header is set only if the sent data is not empty. When the data is empty, no Content-Type header is sent.
Version
2.9.3 / latest