Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions trillian/ctfe/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var (
)

const (
maxAddChainBodyBytes int64 = 512000 // limits add-chain/add-pre-chain body size to prevent memory exhaustion
// HTTP Cache-Control header
cacheControlHeader = "Cache-Control"
// Value for Cache-Control header when response contains immutable data, i.e. entries or proofs. Allows the response to be cached for 1 day.
Expand Down Expand Up @@ -464,6 +465,7 @@ func addChainInternal(ctx context.Context, li *logInfo, w http.ResponseWriter, r
}

// Check the contents of the request and convert to slice of certificates.
r.Body = http.MaxBytesReader(w, r.Body, maxAddChainBodyBytes)
addChainReq, err := ParseBodyAsJSONChain(r)
if err != nil {
var maxBytesErr *http.MaxBytesError
Expand Down