decred / dcrtime

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

Add option to set a single string digest on timestamp request #57

Closed thi4go closed 4 years ago

thi4go commented 4 years ago

This PR was motivated by the no-js version of dcrtimegui redesign. Form data can't be transformed into an array without scripting, so we need an option to send a single string hash to the timestamp route in the backend. This commit makes it possible to send request bodies of the following format:

{
  "digest": "0cb888fa05d77429066994aec46e79f23243bcd6eff9e891d2d25767beedb9e6",
  "digests": ["fa441a7ca6c25057936b32dec6083cc61078003c3907b4f32feabb5ccdb15371"]
}
{
  "digest": "0cb888fa05d77429066994aec46e79f23243bcd6eff9e891d2d25767beedb9e6"
}
{
  "digests": ["fa441a7ca6c25057936b32dec6083cc61078003c3907b4f32feabb5ccdb15371"]
}
thi4go commented 4 years ago

Understood @marcopeereboom, makes sense. I"ll close this issue and open a draft proposal PR with the extra route we'd need for the JS-less app, without overloading any existing ones.