ai cooking
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

more honest about or not found and bad files (#233)

Co-authored-by: paul miller <paul.miller>

authored by

Paul Miller
paul miller
and committed by
GitHub
0caf3528 bde11e77

+7 -1
+7 -1
internal/recipes/server.go
··· 292 292 func (s *server) notFound(ctx context.Context, w http.ResponseWriter, r *http.Request) { 293 293 startArg := r.URL.Query().Get(queryArgStart) 294 294 hashParam := r.URL.Query().Get(queryArgHash) 295 + //okay give them a new start time. 296 + if startArg == "" { 297 + redirectToHash(w, r, hashParam, true /*useStart*/) 298 + return 299 + } 300 + 295 301 if startTime, err := time.Parse(time.RFC3339Nano, startArg); err == nil { 296 302 if time.Since(startTime) > time.Minute*10 { 297 303 p, err := s.ParamsFromCache(ctx, hashParam) ··· 334 340 return 335 341 } 336 342 slog.ErrorContext(ctx, "failed to load recipe list for hash", "hash", hashParam, "error", err) 337 - http.Error(w, "recipe not found or expired", http.StatusNotFound) 343 + http.Error(w, "invalid recipe", http.StatusInternalServerError) 338 344 return 339 345 } 340 346 if r.URL.Query().Has(queryArgStart) {