Forum Settings
Forums

Search API returns invalid Transfer-Encoding header

New
May 12, 2015 6:07 AM
#1

Offline
Nov 2007
725
When the search API doesn't find any results, it returns a "204 No Content" response. This is fine, but it also includes a "Transfer-Encoding: chunked" header in the same response, which is against the HTTP specification:

A server MUST NOT send a Transfer-Encoding header field in any response with a status code of 1xx (Informational) or 204 (No Content).

I imagine this is an issue with MAL's server configuration. In any case, this is confusing some HTTP clients, including curl (and my application that's built on top of libcurl). An example request header would be as following:

GET /api/anime/search.xml?q=Fate%20stay%20night HTTP/1.1
Host: myanimelist.net
Accept: text/xml, text/*
Accept-Charset: utf-8
Accept-Encoding: gzip
Authorization: Basic (...)
User-Agent: (...)

Omitting "Accept-Charset" or "Accept-Encoding" headers don't seem to have any effect. If I omit the "Accept" header, then the response includes "Content-Length: 10", which is even worse for an empty response. I've actually reported this issue more than a year ago. I'd appreciate it if you could look into it.

Also note that the API is quite unreliable: Searching for "Fate stay night" fails, while "Fate/stay night" succeeds. This is not the case for the search functionality on the website.

More topics from this board

» I can't use forums using Windows High Contrast anymore

vasipi4946 - 1 hour ago

0 by vasipi4946 »»
1 hour ago

» [Reported] Username being auto-pasted into search bar

DariTheWeeb - Feb 19

49 by DeadPiles »»
4 hours ago

Sticky: » Inactive Username Request Thread ( 1 2 3 4 5 ... Last Page )

Kineta - Sep 21, 2015

3371 by NotDerb »»
7 hours ago

» IP ban glitch?

AverageRiceFan - Apr 21

2 by hich4n_ »»
10 hours ago

» ishinashi has 300 alt accounts and counting ( 1 2 3 )

deg - Jun 16, 2023

127 by Spunkert »»
Today, 6:05 AM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login