JSON scanner fails when underlying reader reads less than the requested bytes and also returns io.EOF

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 0.2.0
    • Affects Version/s: None
    • Component/s: JSON & ExtJSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Issue is here: https://github.com/mongodb/mongo-go-driver/blob/6310dd3c4b6b7db65c30139cb2396288e7d6a7e1/bson/bsonrw/json_scanner.go#L100-L104

       

      Just because the underying reader returned io.EOF doesn't mean it totally failed. In this case, the gzip.Reader will return EOF and also less than the requested number of bytes, which are still valid bytes.

       

            Assignee:
            Craig Wilson
            Reporter:
            Craig Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: