Skip to content

[BUG] Server return unregister Content-Type: errors for empty body requests #3653

@MikasaAkerman

Description

@MikasaAkerman

What happened:

Server return an error with response code 400

{
    "code": 400,
    "reason": "CODEC",
    "message": "unregister Content-Type: ",
    "metadata": {}
}

What you expected to happen:

Response success

How to reproduce it (as minimally and precisely as possible):

  1. install kratos
  2. create project
  3. add post or put method with empty message
  4. run project
  5. Send post/put request with empty body

Anything else we need to know?:

no

Environment:

  • Kratos version (use kratos -v):

    kratos version v2.8.4

  • Go version (use go version):

    go version go1.24.2 windows/amd64

  • OS (e.g: cat /etc/os-release):

    版本 Windows 11 专业版
    版本号 24H2
    安装日期 ‎2025/‎1/‎13
    操作系统版本 26100.3775
    体验 Windows 功能体验包 1000.26100.66.0

  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions