Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing break after HTTP errors. Change 'Nothing to integrate' case to 400. #73

Merged
merged 2 commits into from
Jan 9, 2024
Merged
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
6 changes: 5 additions & 1 deletion experimental/gcp-log/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ func Integrate(w http.ResponseWriter, r *http.Request) {
http.Error(w,
fmt.Sprintf("Failed to read log checkpoint: %q", err),
http.StatusInternalServerError)
return
}

// Check signatures
Expand All @@ -319,6 +320,7 @@ func Integrate(w http.ResponseWriter, r *http.Request) {
http.Error(w,
fmt.Sprintf("Failed to open Checkpoint: %q", err),
http.StatusInternalServerError)
return
}

// Integrate new entries
Expand All @@ -330,14 +332,16 @@ func Integrate(w http.ResponseWriter, r *http.Request) {
return
}
if newCp == nil {
http.Error(w, "Nothing to integrate", http.StatusInternalServerError)
http.Error(w, "Nothing to integrate", http.StatusBadRequest)
return
}

err = signAndWrite(ctx, newCp, cpNote, noteSigner, client, d.Origin)
if err != nil {
http.Error(w,
fmt.Sprintf("Failed to sign: %q", err),
http.StatusInternalServerError)
return
}

return
Expand Down
Loading