| 744 | } |
| 745 | |
| 746 | func TestEngineHandleContextUseEscapedPathPercentEncoded(t *testing.T) { |
| 747 | r := New() |
| 748 | r.UseEscapedPath = true |
| 749 | r.UnescapePathValues = false |
| 750 | |
| 751 | r.GET("/v1/:path", func(c *Context) { |
| 752 | // Path is Escaped, the %25 is not interpreted as % |
| 753 | assert.Equal(t, "foo%252Fbar", c.Param("path")) |
| 754 | c.Status(http.StatusOK) |
| 755 | }) |
| 756 | |
| 757 | req := httptest.NewRequest(http.MethodGet, "/v1/foo%252Fbar", nil) |
| 758 | w := httptest.NewRecorder() |
| 759 | r.ServeHTTP(w, req) |
| 760 | } |
| 761 | |
| 762 | func TestEngineHandleContextUseRawPathPercentEncoded(t *testing.T) { |
| 763 | r := New() |