handlePlan returns a download plan without starting the download.
(w http.ResponseWriter, r *http.Request)
| 164 | |
| 165 | // handlePlan returns a download plan without starting the download. |
| 166 | func (s *Server) handlePlan(w http.ResponseWriter, r *http.Request) { |
| 167 | var req DownloadRequest |
| 168 | if err := json.NewDecoder(r.Body).Decode(&req); err != nil { |
| 169 | writeError(w, http.StatusBadRequest, "Invalid request body", err.Error()) |
| 170 | return |
| 171 | } |
| 172 | |
| 173 | req.DryRun = true |
| 174 | s.handlePlanInternal(w, req) |
| 175 | } |
| 176 | |
| 177 | func (s *Server) handlePlanInternal(w http.ResponseWriter, req DownloadRequest) { |
| 178 | if req.Repo == "" { |
nothing calls this directly
no test coverage detected