| 760 | } |
| 761 | |
| 762 | func TestEngineHandleContextUseRawPathPercentEncoded(t *testing.T) { |
| 763 | r := New() |
| 764 | r.UseRawPath = true |
| 765 | r.UnescapePathValues = false |
| 766 | |
| 767 | r.GET("/v1/:path", func(c *Context) { |
| 768 | // Path is used, the %25 is interpreted as % |
| 769 | assert.Equal(t, "foo%2Fbar", c.Param("path")) |
| 770 | c.Status(http.StatusOK) |
| 771 | }) |
| 772 | |
| 773 | req := httptest.NewRequest(http.MethodGet, "/v1/foo%252Fbar", nil) |
| 774 | w := httptest.NewRecorder() |
| 775 | r.ServeHTTP(w, req) |
| 776 | } |
| 777 | |
| 778 | func TestEngineHandleContextUseEscapedPathOverride(t *testing.T) { |
| 779 | r := New() |