Avoid double-unescaping of form value (#26853)
1. The old `prepareQueryArg` did double-unescaping of form value. 2. By the way, remove the unnecessary `ctx.Flash = ...` in `MockContext`. Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
e8aae43f56
commit
f01bed2443
4 changed files with 6 additions and 24 deletions
|
@ -50,7 +50,6 @@ func MockContext(t *testing.T, reqPath string) (*context.Context, *httptest.Resp
|
|||
base.Locale = &translation.MockLocale{}
|
||||
|
||||
ctx := context.NewWebContext(base, &MockRender{}, nil)
|
||||
ctx.Flash = &middleware.Flash{Values: url.Values{}}
|
||||
|
||||
chiCtx := chi.NewRouteContext()
|
||||
ctx.Base.AppendContextValue(chi.RouteCtxKey, chiCtx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue