api: fix delete source route

The delete source handler now removes the leading "/" from the
parameters passed to it. Not removing the "/" caused sources to not
be deleted from the store since they could not be found when their name
contained a "/" as the first character.
This commit is contained in:
Jacob Kozol 2019-11-11 14:35:05 +01:00 committed by Tom Gundersen
parent a91b5640de
commit 3aab64575b

View file

@ -278,7 +278,8 @@ func (api *API) sourceDeleteHandler(writer http.ResponseWriter, request *http.Re
return
}
api.store.DeleteSource(name[0])
// remove leading / from first name
api.store.DeleteSource(name[0][1:])
statusResponseOK(writer)
}