diff options
Diffstat (limited to 'handler.go')
-rw-r--r-- | handler.go | 19 |
1 files changed, 0 insertions, 19 deletions
@@ -212,25 +212,6 @@ func updateRecipe(body string, idStr string) { return } -func recipeImageGet(w http.ResponseWriter, r *http.Request) { - - ids := r.URL.Query()["id"] - if len(ids) != 1 { - http.Error(w, "Expected exactly one 'id' URL parameter.", 400) - return - } - idStr := ids[0] - - idRegex := regexp.MustCompile(VALID_ID_REGEX) - if !idRegex.MatchString(idStr) { - http.Error(w, "Bad 'id' URL parameter.", 400) - return - } - - path := fmt.Sprintf("recipes/image/%s.jpg", idStr) - ServeStorage(w, r, path) -} - func addRecipesGet(w http.ResponseWriter, r *http.Request) { ServeTemplate(w, "add.html", nil) |