Upgraded to latest aero version

This commit is contained in:
2019-06-01 13:55:49 +09:00
parent ae591e5e7e
commit 28db818c37
196 changed files with 645 additions and 593 deletions

View File

@ -2,15 +2,15 @@ package middleware
// // HTTPSRedirect middleware redirects to HTTPS if needed.
// func HTTPSRedirect() aero.Middleware {
// return func(ctx *aero.Context, next func()) {
// return func(ctx aero.Context, next func()) {
// request := ctx.Request()
// userAgent := request.Header().Get("User-Agent")
// isBrowser := strings.Contains(userAgent, "Mozilla/") || strings.Contains(userAgent, "Chrome/") || strings.Contains(userAgent, "AppleWebKit/")
// if !strings.HasPrefix(request.Protocol(), "HTTP/2") && isBrowser {
// fmt.Println("Redirect to HTTPS")
// ctx.Redirect("https://" + request.Host() + request.URL().Path)
// ctx.Response().WriteHeader(ctx.StatusCode)
// ctx.Redirect(http.StatusFound, "https://" + request.Host() + request.URL().Path)
// ctx.Response().WriteHeader(ctx.Status())
// return
// }