Skip to content

Commit

Permalink
Add test for colon in final path segment not meant as verb
Browse files Browse the repository at this point in the history
See grpc-ecosystem#224

Signed-off-by: James Hamlin <james@goforward.com>
  • Loading branch information
jfhamlin committed Jul 24, 2018
1 parent 209d7ce commit 1f98a92
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions runtime/mux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,38 @@ func TestMuxServeHTTP(t *testing.T) {
respStatus: http.StatusOK,
respContent: "POST /foo:bar",
},
{
patterns: []stubPattern{
{
method: "GET",
ops: []int{int(utilities.OpLitPush), 0, int(utilities.OpPush), 0, int(utilities.OpConcatN), 1, int(utilities.OpCapture), 1},
pool: []string{"foo", "id"},
},
},
reqMethod: "GET",
reqPath: "/foo/bar",
headers: map[string]string{
"Content-Type": "application/json",
},
respStatus: http.StatusOK,
respContent: "GET /foo/{id=*}",
},
{
patterns: []stubPattern{
{
method: "GET",
ops: []int{int(utilities.OpLitPush), 0, int(utilities.OpPush), 0, int(utilities.OpConcatN), 1, int(utilities.OpCapture), 1},
pool: []string{"foo", "id"},
},
},
reqMethod: "GET",
reqPath: "/foo/bar:123",
headers: map[string]string{
"Content-Type": "application/json",
},
respStatus: http.StatusOK,
respContent: "GET /foo/{id=*}",
},
} {
mux := runtime.NewServeMux()
for _, p := range spec.patterns {
Expand Down

0 comments on commit 1f98a92

Please sign in to comment.