diff options
author | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2020-10-30 13:27:05 +0100 |
---|---|---|
committer | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2020-10-30 13:27:05 +0100 |
commit | b8a8e56d4a311f15060efcd455c444949b2d20b9 (patch) | |
tree | 56b7239cad17fdeb0bb674c305b137bb8d6dcfaa /handler.go | |
parent | 43c8e9b1e44255ecc3d8a0077dc285739cfbb79d (diff) |
started refactoring add-entry code path according to doc
Diffstat (limited to 'handler.go')
-rw-r--r-- | handler.go | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -45,15 +45,10 @@ func (a appHandler) sendHTTPError(w http.ResponseWriter, statusCode int, err err func addEntry(ctx context.Context, i *Instance, w http.ResponseWriter, r *http.Request) (int, error) { glog.Info("in addEntry") - request, err := NewAddEntryRequest(r) + leaf, appendix, err := NewAddEntryRequest(i.LogParameters, r) if err != nil { return http.StatusBadRequest, err - } // request can be decoded - - leaf, appendix, err := VerifyAddEntryRequest(i.LogParameters, request) - if err != nil { - return http.StatusBadRequest, err - } // valid add-entry request + } // request is well-formed, signed, and chains back to a trust anchor trillianRequest := trillian.QueueLeafRequest{ LogId: i.LogParameters.TreeId, |