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

Mixing static + wildcard segment causes hung request #37

Closed
ImVexed opened this issue Jul 23, 2020 · 2 comments
Closed

Mixing static + wildcard segment causes hung request #37

ImVexed opened this issue Jul 23, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@ImVexed
Copy link

ImVexed commented Jul 23, 2020

package main

import (
	"fmt"
	"log"

	"github.com/fasthttp/router"
	"github.com/valyala/fasthttp"
)

func Index(ctx *fasthttp.RequestCtx) {
	ctx.WriteString("Welcome!")
}

func Hello(ctx *fasthttp.RequestCtx) {
	fmt.Fprintf(ctx, "Hello, %s!\n", ctx.UserValue("name"))
}

func main() {
	r := router.New()
	r.GET("/hello/test", Index)
	r.GET("/hello/{name}", Hello)

	fmt.Println("starting")
	log.Fatal(fasthttp.ListenAndServe(":8080", r.Handler))
}

GET: /hello/test returns "Welcome!"
GET: /hello/test1 hangs indefinitely
GET: /hello/tes returns "Hello, tes!"

@savsgio
Copy link
Member

savsgio commented Jul 23, 2020

Hi @ImVexed,

Thanks for your issue. I will fix it as soon as possible.

@savsgio savsgio added the bug Something isn't working label Jul 23, 2020
@savsgio
Copy link
Member

savsgio commented Jul 23, 2020

Fixed!! 🎉

The bugfix is available in the new release v1.2.4.

@savsgio savsgio closed this as completed Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants