···3132func (x *Xrpc) Router() http.Handler {
33 r := chi.NewRouter()
0000000003435- r.With(x.ServiceAuth.VerifyServiceAuth).Post("/"+tangled.RepoSetDefaultBranchNSID, x.SetDefaultBranch)
3600037 return r
38}
3940-// this is slightly different from http_util::write_error to follow the spec:
41-//
42-// the json object returned must include an "error" and a "message"
43func writeError(w http.ResponseWriter, e xrpcerr.XrpcError, status int) {
44 w.Header().Set("Content-Type", "application/json")
45 w.WriteHeader(status)