element-hq / dendrite

Dendrite is a second-generation Matrix homeserver written in Go!
https://element-hq.github.io/dendrite/
GNU Affero General Public License v3.0
33 stars 5 forks source link

Wrong Content-Type for some JSON responses like 404's #3354

Closed matrixbot closed 2 weeks ago

matrixbot commented 2 weeks ago

This issue was originally created by @morguldir at https://github.com/matrix-org/dendrite/issues/3354.

Reported-By: @roughnecks

Background information

Description

Steps to reproduce

Headers

curl https://dendrite.matrix.org/_matrix/client/unstable/org.matrix.msc2965/auth_issuer -I
HTTP/2 404 
date: Sun, 07 Apr 2024 14:16:16 GMT
content-type: text/plain; charset=utf-8
content-length: 59
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS
access-control-allow-origin: *
strict-transport-security: max-age=15724800; includeSubDomains
cf-cache-status: DYNAMIC
server: cloudflare
cf-ray: 870aa26e0a396661-AMS

Explanation

the content is fine, but the Content-Type header must be application/json as per the spec: https://spec.matrix.org/v1.10/client-server-api/#api-standards

Servers must include a Content-Type header of application/json for all JSON responses.

- Michael (t3chguy) => https://matrix.to/#/!YTvKGNlinIzlkMTVRl:matrix.org/$Ccl7mmAOGI8KhBJ0BzOM63Wje1gcmh2IX6tAchUXXZ8?via=matrix.org&via=privacytools.io&via=mozilla.org

matrixbot commented 2 weeks ago

This comment was originally posted by @roughnecks at https://github.com/matrix-org/dendrite/issues/3354#issuecomment-2041513691.

Thanks 👍