Skip to content
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

how to disable golang.org/issue/25192 message? #1875

Open
Akira0215 opened this issue Apr 11, 2022 · 3 comments
Open

how to disable golang.org/issue/25192 message? #1875

Akira0215 opened this issue Apr 11, 2022 · 3 comments

Comments

@Akira0215
Copy link

my url == http://127.0.0.1:8879/test?cmd=2330,0;

func main() {
appIris := iris.New()
appIris.Get("/test", func(ctx iris.Context) {
testParam(ctx)
})
appIris.Run(iris.Addr(8879) /* 0.*/, iris.WithPostMaxMemory(maxSize))
}

func testParam(ctx iris.Context) {
fmt.Println("testParam : ", ctx.Request().URL.RawQuery)
}

always show message
[HTTP Server] http: URL query contains semicolon, which is no longer a supported separator; parts of the query may be stripped when parsed; see golang.org/issue/25192

need to fix or disable it

thanks ~

@kataras
Copy link
Owner

kataras commented Apr 12, 2022

Hello @Akira0215, that's a good one.

Based on the comments at golang/go#25192 (comment) and golang/go#25192 (comment), after go 1.17 (caused the issue). We have the option to use a middleware to convert the ; to & or/and ignore the http server warning log. I've just pushed a commit which can solve your(and thousands more) issue. Update your Iris version to the latest commit and follow:

replace ; with &:

app := iris.New()
app.UseRouter(iris.AllowQuerySemicolons)

or/and just ignore the standard http warning log:

app.Run(iris.Addr(":8879"), iris.WithoutServerError(iris.ErrURLQuerySemicolon))
// OR
app.Listen(":8879", iris.WithoutServerError(iris.ErrURLQuerySemicolon))

Thanks!

@Akira0215
Copy link
Author

@kataras thank you very much
i will wait next version.
thank you

@kataras
Copy link
Owner

kataras commented Apr 13, 2022

It' already released @Akira0215, go get github.com/kataras/iris/v12@v12.2.0-beta1 or just @master. You are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants