Fix server crash when no local plugins provided

Bug: Issue 6579
Change-Id: I9e90d21f868967097a533cefd6dba4b5260b6956
This commit is contained in:
Viktar Donich 2017-06-27 09:42:22 -07:00
parent 0235864ef7
commit 653b6bc769

View File

@ -122,6 +122,9 @@ func patchResponse(r *http.Request, res *http.Response) io.Reader {
}
func injectLocalPlugins(r io.Reader) io.Reader {
if len(*plugins) == 0 {
return r
}
// Skip escape prefix
io.CopyN(ioutil.Discard, r, 5)
dec := json.NewDecoder(r)