redirectRequest() — gin Function Reference
Architecture documentation for the redirectRequest() function in gin.go from the gin codebase.
Entity Profile
Dependency Diagram
graph TD 0c112b3d_e60f_10d6_31b8_9f700dd18e61["redirectRequest()"] a3ad729e_6252_c42c_5a77_556e798082aa["redirectTrailingSlash()"] a3ad729e_6252_c42c_5a77_556e798082aa -->|calls| 0c112b3d_e60f_10d6_31b8_9f700dd18e61 80b1d193_8c18_8a4b_2f6c_ba930413c631["redirectFixedPath()"] 80b1d193_8c18_8a4b_2f6c_ba930413c631 -->|calls| 0c112b3d_e60f_10d6_31b8_9f700dd18e61 style 0c112b3d_e60f_10d6_31b8_9f700dd18e61 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
gin.go lines 820–832
func redirectRequest(c *Context) {
req := c.Request
rPath := req.URL.Path
rURL := req.URL.String()
code := http.StatusMovedPermanently // Permanent redirect, request with GET method
if req.Method != http.MethodGet {
code = http.StatusTemporaryRedirect
}
debugPrint("redirecting request %d: %s --> %s", code, rPath, rURL)
http.Redirect(c.Writer, req, rURL, code)
c.writermem.WriteHeaderNow()
}
Domain
Subdomains
Source
Frequently Asked Questions
What does redirectRequest() do?
redirectRequest() is a function in the gin codebase.
What calls redirectRequest()?
redirectRequest() is called by 2 function(s): redirectFixedPath, redirectTrailingSlash.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free