MCPcopy Create free account
hub / github.com/PuerNya/git-proxy / responseWithRedirect

Function responseWithRedirect

main.go:658–664  ·  view source on GitHub ↗
(URL *url.URL)

Source from the content-addressed store, hash-verified

656}
657
658func responseWithRedirect(URL *url.URL) http.Handler {
659 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
660 log.InfoContext(r.Context(), "Success redirect request: ", r.URL.RequestURI(), " to: /", URL.String())
661 w.Header().Set("Location", "/"+URL.String())
662 w.WriteHeader(http.StatusTemporaryRedirect)
663 })
664}
665
666var _ io.Reader = (*LimitReader)(nil)
667

Callers 1

finalHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected