mirror of
https://github.com/labstack/echo.git
synced 2025-11-27 22:38:25 +02:00
use echo.GetPath for rewrite in proxy (#1548)
Co-authored-by: Arun Gopalpuri <arun@gopalpuri.com>
This commit is contained in:
@@ -104,6 +104,10 @@ func TestProxy(t *testing.T) {
|
||||
e.ServeHTTP(rec, req)
|
||||
assert.Equal(t, "/user/jack/order/1", req.URL.Path)
|
||||
assert.Equal(t, http.StatusOK, rec.Code)
|
||||
req.URL.Path = "/users/jill/orders/T%2FcO4lW%2Ft%2FVp%2F"
|
||||
e.ServeHTTP(rec, req)
|
||||
assert.Equal(t, "/user/jill/order/T%2FcO4lW%2Ft%2FVp%2F", req.URL.Path)
|
||||
assert.Equal(t, http.StatusOK, rec.Code)
|
||||
|
||||
// ProxyTarget is set in context
|
||||
contextObserver := func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
|
||||
Reference in New Issue
Block a user