Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(979)

Unified Diff: milo/frontend/middleware.go

Issue 2976393002: Milo: Fix ?limit= param (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: milo/frontend/middleware.go
diff --git a/milo/frontend/middleware.go b/milo/frontend/middleware.go
index 7c750c2d03bcdbd056f48ca5816f69b6b68625d2..f5e5cccbe2d6af658d34807fa1763555eafd85bc 100644
--- a/milo/frontend/middleware.go
+++ b/milo/frontend/middleware.go
@@ -252,13 +252,7 @@ func GetLimit(r *http.Request) (int, error) {
// both are unspecified, then limit is omitted.
func pagedURL(r *http.Request, limit int, cursor string) string {
if limit == 0 {
- var err error
- limit, err = GetLimit(r)
- if err != nil {
- // This should not happen because the handler should've already validated the
- // limit earlier in the process.
- panic(err)
- }
+ limit, _ = GetLimit(r) // This returns -1 on error.
if limit < 0 {
limit = 0
}

Powered by Google App Engine
This is Rietveld 408576698