@@ -162,7 +162,6 @@ func AddContext(next http.Handler) http.Handler {
162
162
// in, and supply no context.
163
163
//
164
164
next .ServeHTTP (w , r )
165
- return
166
165
})
167
166
}
168
167
@@ -352,7 +351,7 @@ func ackEvent(res http.ResponseWriter, req *http.Request) {
352
351
//
353
352
username := req .Context ().Value (keyUser )
354
353
if username == nil {
355
- http .Redirect (res , req , "/login" , 302 )
354
+ http .Redirect (res , req , "/login" , http . StatusFound )
356
355
return
357
356
}
358
357
@@ -363,7 +362,7 @@ func ackEvent(res http.ResponseWriter, req *http.Request) {
363
362
id := vars ["id" ]
364
363
365
364
storage .AckEvent (id )
366
- http .Redirect (res , req , "/" , 302 )
365
+ http .Redirect (res , req , "/" , http . StatusFound )
367
366
368
367
}
369
368
@@ -377,7 +376,7 @@ func clearEvent(res http.ResponseWriter, req *http.Request) {
377
376
//
378
377
username := req .Context ().Value (keyUser )
379
378
if username == nil {
380
- http .Redirect (res , req , "/login" , 302 )
379
+ http .Redirect (res , req , "/login" , http . StatusFound )
381
380
return
382
381
}
383
382
@@ -388,7 +387,7 @@ func clearEvent(res http.ResponseWriter, req *http.Request) {
388
387
id := vars ["id" ]
389
388
390
389
storage .ClearEvent (id )
391
- http .Redirect (res , req , "/" , 302 )
390
+ http .Redirect (res , req , "/" , http . StatusFound )
392
391
393
392
}
394
393
@@ -401,7 +400,7 @@ func raiseEvent(res http.ResponseWriter, req *http.Request) {
401
400
//
402
401
username := req .Context ().Value (keyUser )
403
402
if username == nil {
404
- http .Redirect (res , req , "/login" , 302 )
403
+ http .Redirect (res , req , "/login" , http . StatusFound )
405
404
return
406
405
}
407
406
@@ -412,7 +411,7 @@ func raiseEvent(res http.ResponseWriter, req *http.Request) {
412
411
id := vars ["id" ]
413
412
414
413
storage .RaiseEvent (id )
415
- http .Redirect (res , req , "/" , 302 )
414
+ http .Redirect (res , req , "/" , http . StatusFound )
416
415
417
416
}
418
417
@@ -422,11 +421,11 @@ func raiseEvent(res http.ResponseWriter, req *http.Request) {
422
421
func serveResource (response http.ResponseWriter , request * http.Request , resource string , mime string ) {
423
422
tmpl , err := getResource (resource )
424
423
if err != nil {
425
- fmt .Fprintf (response , err .Error ())
424
+ fmt .Fprint (response , err .Error ())
426
425
return
427
426
}
428
427
response .Header ().Set ("Content-Type" , mime )
429
- fmt .Fprintf (response , string (tmpl ))
428
+ fmt .Fprint (response , string (tmpl ))
430
429
}
431
430
432
431
//
@@ -473,14 +472,14 @@ func loginHandler(response http.ResponseWriter, request *http.Request) {
473
472
http .SetCookie (response , cookie )
474
473
}
475
474
476
- http .Redirect (response , request , "/" , 302 )
475
+ http .Redirect (response , request , "/" , http . StatusFound )
477
476
return
478
477
}
479
478
480
479
//
481
480
// Failure to login, redirect to try again.
482
481
//
483
- http .Redirect (response , request , "/login#failed" , 302 )
482
+ http .Redirect (response , request , "/login#failed" , http . StatusFound )
484
483
}
485
484
486
485
//
@@ -494,7 +493,7 @@ func logoutHandler(response http.ResponseWriter, request *http.Request) {
494
493
MaxAge : - 1 ,
495
494
}
496
495
http .SetCookie (response , cookie )
497
- http .Redirect (response , request , "/" , 302 )
496
+ http .Redirect (response , request , "/" , http . StatusFound )
498
497
}
499
498
500
499
//
@@ -509,7 +508,7 @@ func eventsHandler(response http.ResponseWriter, request *http.Request) {
509
508
//
510
509
username := request .Context ().Value (keyUser )
511
510
if username == nil {
512
- http .Redirect (response , request , "/login" , 302 )
511
+ http .Redirect (response , request , "/login" , http . StatusFound )
513
512
return
514
513
}
515
514
@@ -547,7 +546,7 @@ func indexPageHandler(response http.ResponseWriter, request *http.Request) {
547
546
//
548
547
username := request .Context ().Value (keyUser )
549
548
if username == nil {
550
- http .Redirect (response , request , "/login" , 302 )
549
+ http .Redirect (response , request , "/login" , http . StatusFound )
551
550
return
552
551
}
553
552
0 commit comments