[File] Question Regarding is_json.c

Puvipavan p.puvipavan at gmail.com
Tue Feb 6 13:39:50 UTC 2024


  Hello there,

I'm not sure whether this is a right place to ask/recommend any fixes,
please direct me to the right place, if I'm wrong.

Following JSON is valid according to RFC 7159/8259:
[
  {
    "id": "123",
    "labels": []
  }
]

But it's returning mime type as text/plain whenever there is an empty array.

Originally I ran into this issue while using the function finfo_file in
PHP. While debugging it, I found out that PHP is internally using your
libraries. Looks like following function expecting a value inside an array:
https://github.com/file/file/blob/master/src/is_json.c#L180

Is it expected or Am I missing something?

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.astron.com/pipermail/file/attachments/20240206/047ad06c/attachment.htm>


More information about the File mailing list