Home / Function/ TestEngineHandleContextUseEscapedPathPercentEncoded() — gin Function Reference

TestEngineHandleContextUseEscapedPathPercentEncoded() — gin Function Reference

Architecture documentation for the TestEngineHandleContextUseEscapedPathPercentEncoded() function in gin_test.go from the gin codebase.

Entity Profile

Relationship Graph

Source Code

gin_test.go lines 746–760

func TestEngineHandleContextUseEscapedPathPercentEncoded(t *testing.T) {
	r := New()
	r.UseEscapedPath = true
	r.UnescapePathValues = false

	r.GET("/v1/:path", func(c *Context) {
		// Path is Escaped, the %25 is not interpreted as %
		assert.Equal(t, "foo%252Fbar", c.Param("path"))
		c.Status(http.StatusOK)
	})

	req := httptest.NewRequest(http.MethodGet, "/v1/foo%252Fbar", nil)
	w := httptest.NewRecorder()
	r.ServeHTTP(w, req)
}

Domain

Subdomains

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free