-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] #1968
Labels
Comments
Hello @secsys-go, fetch the latest main.go package main
import "github.com/kataras/iris/v12"
func main() {
// app := iris.New()
// app.Get("/test/{p:string eqor([:,*])}", func(ctx iris.Context) {
// ctx.Writef("Hi, %s", ctx.Params().Get("p"))
// })
app := newApp()
app.Listen(":8080")
}
const expectedResponse = "no_userouter_allowed"
func newApp() *iris.Application {
app := iris.New()
app.UseRouter(func(ctx iris.Context) {
ctx.WriteString("always")
ctx.Next()
})
app.Get("/index", func(ctx iris.Context) {
ctx.WriteString(expectedResponse)
})
app.SetPartyMatcher(func(ctx iris.Context, p iris.Party) bool {
// modifies the PartyMatcher to not match any UseRouter,
// tests should receive the handlers response alone.
return false
})
var1 := "\\"
app.PartyFunc(var1, func(p iris.Party) { // it's the same instance of app.
p.UseRouter(func(ctx iris.Context) {
ctx.WriteString("_2")
ctx.Next()
})
p.Get("/", func(ctx iris.Context) {
ctx.WriteString(expectedResponse)
})
})
var2 := "*\\*\\*"
app.PartyFunc(var2, func(p iris.Party) {
p.UseRouter(func(ctx iris.Context) {
ctx.WriteString("_3")
ctx.Next()
})
p.Get("/", func(ctx iris.Context) {
ctx.WriteString(expectedResponse)
})
})
return app
} main_test.go package main
import (
"testing"
"github.com/kataras/iris/v12/httptest"
)
func TestIssue(t *testing.T) {
app := newApp()
e := httptest.New(t, app)
e.GET("/").Expect().Status(httptest.StatusOK).Body().Equal(expectedResponse)
e.GET("/user").Expect().Status(httptest.StatusNotFound)
e.GET("/*/*/*").Expect().Status(httptest.StatusOK).Body().Equal(expectedResponse)
// e.GET("/*/*/anything").Expect().Status(httptest.StatusNotFound)
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
We used the Fuzz engine to modify some Test(TestUseRouterParentDisallow) data, and then the following crash appeared. We hope to get the help of the developer to confirm whether it is a real bug.
To Reproduce
Crash log
Desktop:
iris.Version
The text was updated successfully, but these errors were encountered: