MCPcopy
hub / github.com/gin-gonic/gin / redirectFixedPath

Function redirectFixedPath

gin.go:808–818  ·  view source on GitHub ↗
(c *Context, root *node, trailingSlash bool)

Source from the content-addressed store, hash-verified

806}
807
808func redirectFixedPath(c *Context, root *node, trailingSlash bool) bool {
809 req := c.Request
810 rPath := req.URL.Path
811
812 if fixedPath, ok := root.findCaseInsensitivePath(cleanPath(rPath), trailingSlash); ok {
813 req.URL.Path = bytesconv.BytesToString(fixedPath)
814 redirectRequest(c)
815 return true
816 }
817 return false
818}
819
820func redirectRequest(c *Context) {
821 req := c.Request

Callers 1

handleHTTPRequestMethod · 0.85

Calls 4

BytesToStringFunction · 0.92
cleanPathFunction · 0.85
redirectRequestFunction · 0.85

Tested by

no test coverage detected