Skip to content

Commit

Permalink
httpd: add a test case for StripSlash middleware
Browse files Browse the repository at this point in the history
Signed-off-by: Nicola Murino <[email protected]>
  • Loading branch information
drakkan committed Oct 8, 2023
1 parent da0eb50 commit 63972ed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/httpd/httpd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22881,6 +22881,12 @@ func TestNameParamSingleSlash(t *testing.T) {
groupGet, _, err := httpdtest.GetGroupByName(group.Name, http.StatusOK)
assert.NoError(t, err)
assert.Equal(t, "/", groupGet.Name)
// check strip slash
req, err = http.NewRequest(http.MethodGet, webGroupsPath+"/", nil)
assert.NoError(t, err)
setJWTCookieForReq(req, webToken)
rr = executeRequest(req)
checkResponseCode(t, http.StatusOK, rr)
// cleanup
req, err = http.NewRequest(http.MethodDelete, groupPath+"/"+url.PathEscape(group.Name), nil)
assert.NoError(t, err)
Expand Down

0 comments on commit 63972ed

Please sign in to comment.