// OKTiny sends a HTTP response with status code 200.
429343
func (ctx *ShowBottleContext) OKTiny(r *BottleTiny) error {
	if ctx.ResponseData.Header().Get("Content-Type") == "" {
		ctx.ResponseData.Header().Set("Content-Type", "application/vnd.bottle+json")
	}
	return ctx.ResponseData.Service.Send(ctx.Context, 200, r)
}
407434
func (rc *ReadinessCheck) SetHTTPStatusCodesForReady(codes []int) *ReadinessCheck {
	rc.HTTPStatusCodesForReady = &codes
	return rc
}
245043
func (r *DynamicRouter) ServeHTTP(res http.ResponseWriter, req *http.Request) {
	w := &responseWrapper{ResponseWriter: res, status: 200, body: []byte{}}
	hj, ok := res.(http.Hijacker)
	if ok {
		w.Hijacker = hj
	}
	defer func() {
		if r := recover(); r != nil {
			// we dunno what's happened so, we set the
			// status code to 500
			w.WriteHeader(http.StatusInternalServerError)
			w.flush()
		}
	}()
	n, err := r.findEndpoint(req)
	if err != nil {
		w.WriteHeader(http.StatusNotFound)
		w.flush()
	} else if n.handler != nil {
		// we pass all filter in the right order. if one return false
		// we return, assuming that everything has been written in response
		for _, filter := range n.filters {
			if !filter(w, req) {
				w.flush()
				return
			}
		}
		n.handler(r.ctx, w, req)
		w.flush()
	}
}
560426
func (ctx *ShowAccountContext) OKLink(r *AccountLink) error {
	if ctx.ResponseData.Header().Get("Content-Type") == "" {
		ctx.ResponseData.Header().Set("Content-Type", "application/vnd.account+json")
	}
	return ctx.ResponseData.Service.Send(ctx.Context, 200, r)
}
772640
func StatusCode(err error) int {
	switch t := err.(type) {
	case util.HTTPError:
		return t.Code
	case *util.HTTPError:
		return t.Code
	case *oauth.Error:
		return t.Code
	default:
		return http.StatusInternalServerError
	}
}
827790
func (status Status) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
	if cfg := httpserver.ConfigSelector(status.Rules).Select(r); cfg != nil {
		rule := cfg.(*Rule)

		if rule.StatusCode < 400 {
			// There's no ability to return response body --
			// write the response status code in header and signal
			// to other handlers that response is already handled
			w.WriteHeader(rule.StatusCode)
			return 0, nil
		}

		return rule.StatusCode, nil
	}

	return status.Next.ServeHTTP(w, r)
}
314670
func (rp *Reply) StatusValue() (string, error) {
	if rp.Type == ErrorReply {
		return "", errors.New(rp.Error)
	}
	if rp.Type != StatusReply {
		return "", errors.New("invalid reply type, not status")
	}
	return rp.Status, nil
}
533312
func (brs *blockResponseSender) SendStatusResponse(status common.Status) error {
	reply := &peer.DeliverResponse{
		Type: &peer.DeliverResponse_Status{Status: status},
	}
	return brs.Send(reply)
}
622385
func R200(w http.ResponseWriter, data interface{}) {
	SendResponse(w, data, http.StatusOK)
}
1207610
func (ctx *ListAccountContext) OKTiny(r AccountTinyCollection) error {
	if ctx.ResponseData.Header().Get("Content-Type") == "" {
		ctx.ResponseData.Header().Set("Content-Type", "application/vnd.account+json; type=collection")
	}
	if r == nil {
		r = AccountTinyCollection{}
	}
	return ctx.ResponseData.Service.Send(ctx.Context, 200, r)
}
137513
func (r *Response) Status(code int) *Response {
	r.StatusCode = code
	return r
}
482524
func (ctx *Context) OkSend(val interface{}) error {
	return ctx.Send(http.StatusOK, val)
}
833423
func (ctx *Context) OkHTML(str string) error {
	return ctx.HTML(http.StatusOK, str)
}
514530
func (ctx *ListBottleContext) OK(r BottleCollection) error {
	if ctx.ResponseData.Header().Get("Content-Type") == "" {
		ctx.ResponseData.Header().Set("Content-Type", "application/vnd.bottle+json; type=collection")
	}
	if r == nil {
		r = BottleCollection{}
	}
	return ctx.ResponseData.Service.Send(ctx.Context, 200, r)
}
1223034
func Orthodox() {
	DefaultMux.Middleware(ResponseMapper())
	DefaultMux.Middleware(HTTPRWDI())
	DefaultMux.Middleware(ContextDI())
	DefaultMux.Middleware(RequestObjectMapper())
}
1250940
func (rb *ResponseBuffer) WriteHeader(status int) {
	if rb.wroteHeader {
		return
	}
	rb.wroteHeader = true

	rb.status = status
	rb.stream = !rb.shouldBuffer(status, rb.header)
	if rb.stream {
		rb.CopyHeader()
		rb.ResponseWriterWrapper.WriteHeader(status)
	}
}
91385
func (resp *Response) WriteHeader(defaultStatusCode int, defaultContentType string) {
	if resp.ContentType == "" {
		resp.ContentType = defaultContentType
	}
	resp.Out.internalHeader.Set("Content-Type", resp.ContentType)
	if resp.Status == 0 {
		resp.Status = defaultStatusCode
	}
	resp.SetStatus(resp.Status)
}