API responses - the Content-Type header should be consistent with response format #390

Open
opened 2026-10-04 23:56:10 +02:00 by adam · 1 comment
Owner

I noticed that Piwigo (tested on version 2.7.4) supplies an incorrect Content-Type header in its API responses. It says text/plain when it should be application/json.
When response is XML, the Content-Type needs to be application/xml.
Thank you.

I noticed that Piwigo (tested on version 2.7.4) supplies an incorrect Content-Type header in its API responses. It says text/plain when it should be _application/json_. When response is XML, the Content-Type needs to be _application/xml_. Thank you. <!-- github-sync-id:128589295 -->
Author
Owner

see pullrequest #510 for a fix in the json_encoder.

Concerning the XML API: RFC 2376 allows both application/xml and text/xml with the main difference being the allowed encoding (limited to Text encoding for text/xml)

see pullrequest #510 for a fix in the json_encoder. Concerning the XML API: [RFC 2376](http://www.ietf.org/rfc/rfc2376.txt) allows both `application/xml` and `text/xml` with the main difference being the allowed encoding (limited to Text encoding for `text/xml`) <!-- github-comment-id:235529507 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#390