#1782 util.json fails to parse empty array with whitespace

Reporter MattJ
Owner MattJ
Created
Updated
Stars ★ (1)
Tags
  • Type-Defect
  • Status-Fixed
  • Milestone-0.12
  • Priority-Medium
  1. MattJ on

    What steps will reproduce the problem? 1. json.decode("[ ]") 2. json.decode("[\n]") What is the expected output? An empty array should be returned. What do you see instead? Parsing fails with the error "value expected". What version of the product are you using? On what operating system? Prosody 0.12.1. Please provide any additional information below. The parser fails to skip whitespace in the case that no value was found. Instead it simply checks to see if the next character was ']' (end of array).

  2. MattJ on

    Fixed in https://hg.prosody.im/trunk/rev/997f3ca90628 for 0.12.

    Changes
    • tags Status-Fixed
    • owner MattJ

New comment

Not published. Used for spam prevention and optional update notifications.