Uploaded image for project: 'ListenBrainz'
  1. ListenBrainz
  2. LB-1035

500 error when sending an array to /1/submit-listens

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • API
    • None

      If you submit an array (empty or filled) as the payload to /1/submit-listens

      E.g. this request:

      POST /1/submit-listens HTTP/2
      Authorization: Token ***
      Content-Type: application/json
      []

      Result:

      HTTP/2 500 Internal Server Error
      {"code":500,"error":"An unknown error occured."}

      If you instead submit as body some other JSON that is not a valid request, e.g. {}, then it gives the below result:

      HTTP/2 400 Bad Request
      {"code":400,"error":"Invalid JSON document submitted."}

      This is also what I would expect for the empty array request.

       

            kartik1712 amCap1712
            outsidecontext Philipp Wolfer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package