E3EE [API] `serializeForm` with no form fields does not send `Content-Type` header · Issue #2926 · fomantic/Fomantic-UI · GitHub
[go: up one dir, main page]

Skip to content

[API] serializeForm with no form fields does not send Content-Type header #2926

@mvorisek

Description

@mvorisek

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/upstreamAny issues in dependenciestype/usageAny support issues asking for help

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0