metacpan-api icon indicating copy to clipboard operation
metacpan-api copied to clipboard

Endpoint `/v1/release/files_by_category` is unexpectedly sensitive to the `Content-Type` submitted

Open jackdeguest opened this issue 1 year ago • 0 comments

The endpoint /v1/release/files_by_category[1] is unexpectedly sensitive to the Content-Type submitted, although no data is submitted nor required.

Consider the following query:

curl -H "Content-Type: application/json" -XPOST https://fastapi.metacpan.org/v1/release/files_by_category/OALDERS/HTTP-Message-6.36

would yield a 500 Internal Server Error, whereas:

curl -XPOST https://fastapi.metacpan.org/v1/release/files_by_category/OALDERS/HTTP-Message-6.36

which simply has no Content-Type header would return a 200 OK

[1] https://github.com/metacpan/metacpan-api/blob/d87b27522e6584fcd3fb0eacea8f0b0745633d07/lib/MetaCPAN/Server/Controller/Release.pm#L120

jackdeguest avatar Aug 31 '23 02:08 jackdeguest