Skip to content

Commit

Permalink
serve: write status header for no body responses (#38)
Browse files Browse the repository at this point in the history
What
Sets the status header explicitly to 200 when not using httpjson.Render.

Why
Header is not set by default.
  • Loading branch information
daniel-burghardt authored Sep 5, 2024
1 parent 471d623 commit 5fcb524
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/serve/httphandler/account_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ func (h AccountHandler) RegisterAccount(w http.ResponseWriter, r *http.Request)
httperror.InternalServerError(ctx, "", err, nil).Render(w)
return
}

w.WriteHeader(http.StatusOK)
}

func (h AccountHandler) DeregisterAccount(w http.ResponseWriter, r *http.Request) {
Expand All @@ -53,6 +55,8 @@ func (h AccountHandler) DeregisterAccount(w http.ResponseWriter, r *http.Request
httperror.InternalServerError(ctx, "", err, nil).Render(w)
return
}

w.WriteHeader(http.StatusOK)
}

type SponsorAccountCreationRequest struct {
Expand Down

0 comments on commit 5fcb524

Please sign in to comment.