diff --git a/resource.go b/resource.go index 0f76a94..257575d 100644 --- a/resource.go +++ b/resource.go @@ -30,7 +30,7 @@ func NewResource(list, create Func, get, update, delete IDFunc) *Resource { func (resource *Resource) Handle(path string, w http.ResponseWriter, req *http.Request, user *auth.User) bool { // Get the subpath out of the path subpath := req.URL.Path[len(path):] - if subpath[0] == '/' { + if len(subpath) > 0 && subpath[0] == '/' { subpath = subpath[1:] }