Bugfix: return error when go.mod can't be loaded

This commit is contained in:
BartekDymowski 2022-05-11 11:21:24 +02:00
parent 68959a741a
commit 34637ebe9d

View File

@ -303,9 +303,11 @@ func (api *api) mod(w http.ResponseWriter, r *http.Request, module, version stri
} }
} }
} }
w.Write([]byte(fmt.Sprintf("module %s\n", module)))
return
} }
} }
w.Write([]byte(fmt.Sprintf("module %s\n", module))) http.Error(w, err.Error(), http.StatusBadRequest)
} }
func (api *api) zip(w http.ResponseWriter, r *http.Request, module, version string) { func (api *api) zip(w http.ResponseWriter, r *http.Request, module, version string) {