Home / Function/ TestEngineHandleContextUseRawPathPercentEncoded() — gin Function Reference

TestEngineHandleContextUseRawPathPercentEncoded() — gin Function Reference

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

Entity Profile

Relationship Graph

Source Code

gin_test.go lines 762–776

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

	r.GET("/v1/:path", func(c *Context) {
		// Path is used, the %25 is interpreted as %
		assert.Equal(t, "foo%2Fbar", 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