husobee/vestigo

405 Response When URL Parameter is empty

husobee opened this issue · 1 comments

There is a problem with the tree insertion, where if a user-agent requests a url that has an empty url parameter, a 405 response status code occurs.

example:

router.Get("/v:version/test/:testid", f) 
curl -XGET http://localhost/v3/test/ -D -
HTTP/1.1 405 Method Not Allowed
Allow: GET
Date: Wed, 23 Sep 2015 21:51:12 GMT
Content-Length: 18
Content-Type: text/plain; charset=utf-8

Believe the issue is happening due to the split node in the insertion.

c1193e0 <- this commit fixes this bug, implemented a "clean" mechanism on the resource which cleans up the allowMethods string artifact from split nodes. Also added in a flag to AllowTrace.