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

Bugfix - Redirect fixed path #49

Merged
merged 4 commits into from
Mar 26, 2021
Merged

Bugfix - Redirect fixed path #49

merged 4 commits into from
Mar 26, 2021

Conversation

kimkit
Copy link
Contributor

@kimkit kimkit commented Mar 18, 2021

package main

import (
        "log"

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

func hello(ctx *fasthttp.RequestCtx) {
        // todo
}

func main() {
        r := router.New()
        r.GET("/hello/{a}/{b}/{c}", hello)
        r.ServeFiles("/{filepath:*}", "static")

        log.Fatal(fasthttp.ListenAndServe(":18080", r.Handler))
}
$ curl -v http://localhost:18080/hello/a
* About to connect() to localhost port 18080 (#0)
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 18080 (#0)
> GET /hello/a HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:18080
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Server: fasthttp
< Date: Thu, 18 Mar 2021 09:00:12 GMT
< Content-Length: 0
< Location: http://localhost:18080/hhello/a
< 
* Connection #0 to host localhost left intact

The location url is error.

@coveralls
Copy link

coveralls commented Mar 18, 2021

Pull Request Test Coverage Report for Build 240

  • 16 of 16 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 236: 0.0%
Covered Lines: 982
Relevant Lines: 982

💛 - Coveralls

@savsgio
Copy link
Member

savsgio commented Mar 22, 2021

Hi @kimkit,

Please, fix the tests and coverage. After, I will merge the PR.

@kimkit
Copy link
Contributor Author

kimkit commented Mar 22, 2021

@savsgio Can you merge the PR and create a tag, thanks.

@savsgio savsgio merged commit cc03ff3 into fasthttp:master Mar 26, 2021
@savsgio
Copy link
Member

savsgio commented Mar 26, 2021

@kimkit Thanks!

@savsgio savsgio changed the title Bugfix Bugfix - Redirect fixed path Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants