Fixed panic on Resource when posting to /name instead of /name/
This commit is contained in:
+1
-1
@@ -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:]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user