aboutsummaryrefslogtreecommitdiff
path: root/handler.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-10-30 13:27:05 +0100
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-10-30 13:27:05 +0100
commitb8a8e56d4a311f15060efcd455c444949b2d20b9 (patch)
tree56b7239cad17fdeb0bb674c305b137bb8d6dcfaa /handler.go
parent43c8e9b1e44255ecc3d8a0077dc285739cfbb79d (diff)
started refactoring add-entry code path according to doc
Diffstat (limited to 'handler.go')
-rw-r--r--handler.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/handler.go b/handler.go
index c86281f..ae91bef 100644
--- a/handler.go
+++ b/handler.go
@@ -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,