Skip to content

Escaped forward slashes in path parameter #587

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

Closed
cdfox opened this issue Jun 29, 2016 · 2 comments
Closed

Escaped forward slashes in path parameter #587

cdfox opened this issue Jun 29, 2016 · 2 comments
Assignees

Comments

@cdfox
Copy link

cdfox commented Jun 29, 2016

Is there a way to use an escaped forward slash ("%2F") in a path parameter? I modified the hello world example from the README slightly to take a path parameter and am getting a 404 when I send an escaped URL. For example: http://localhost:8080/https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FWindsor_Castle%23%2Fmedia%2FFile%3AWindsor_Castle_at_Sunset_-_Nov_2006.jpg

This is the modified hello world example:

package main

import (
    "net/http"
    "github.com/labstack/echo"
    "github.com/labstack/echo/engine/standard"
)

func main() {
    e := echo.New()
    e.GET("/:name", func(c echo.Context) error {
        return c.String(http.StatusOK, "Hello, " + c.Param("name") + "!")
    })
    e.Run(standard.New(":8080"))
}
@vishr vishr self-assigned this Jun 29, 2016
@vishr vishr closed this as completed in c00d017 Jun 29, 2016
@vishr
Copy link
Member

vishr commented Jun 29, 2016

@cdfox Please verify

@cdfox
Copy link
Author

cdfox commented Jun 29, 2016

Thanks for the quick response! Yes, it works.

kamilchm added a commit to kamilchm/echo that referenced this issue Dec 19, 2016
Support escaped forward slashes in path parameter
kamilchm added a commit to kamilchm/echo that referenced this issue Dec 19, 2016
Support escaped forward slashes in path parameter
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