decred / dcrtime

Decred anchored timestamp client, proxy, and server.
ISC License
28 stars 23 forks source link

Add config to json decoder #58

Closed thi4go closed 4 years ago

thi4go commented 4 years ago

Right now, the code is processing requests with unknown json fields that are not specified by the API. DisallowUnknownFields() makes the decoder error out when this happens.

Example of bad request to timestamp:

{ random_field_name: "random value"} 

response:

{
    "id": "",
    "servertimestamp": 1575118800,
    "digests": null,
    "results": []
}

It should error out with Invalid request payload. This PR fixes this.

thi4go commented 4 years ago

This is being addressed in #60, so this PR is no longer needed.