redirect.go
This file
The walk stopped after 200 commits: lines older than cf32d2d point at it.
chore(deps): bump github.com/pelletier/go-toml/v2 from 2.2.2 to 2.2.4 (#4212)dependabot[bot]before adoptioncf32d2d
lines 1–29why, one step back1// Copyright 2014 Manu Martinez-Almeida. All rights reserved.2// Use of this source code is governed by a MIT style3// license that can be found in the LICENSE file.45package render67import (8 "fmt"9 "net/http"10)1112// Redirect contains the http request reference and redirects status code and location.13type Redirect struct {14 Code int15 Request *http.Request16 Location string17}1819// Render (Redirect) redirects the http request to new location and writes redirect response.20func (r Redirect) Render(w http.ResponseWriter) error {21 if (r.Code < http.StatusMultipleChoices || r.Code > http.StatusPermanentRedirect) && r.Code != http.StatusCreated {22 panic(fmt.Sprintf("Cannot redirect with status code %d", r.Code))23 }24 http.Redirect(w, r.Request, r.Location, r.Code)25 return nil26}2728// WriteContentType (Redirect) don't write any ContentType.29func (r Redirect) WriteContentType(http.ResponseWriter) {}