Updated userinfo middleware

This commit is contained in:
Eduard Urbach 2018-03-25 17:32:42 +02:00
parent 9b0d20164f
commit 39e445bf71

View File

@ -19,12 +19,9 @@ func UserInfo() aero.Middleware {
next()
// Ignore non-HTML requests
if aero.IsMediaType(ctx.Response().Header().Get("Content-Type")) {
return
}
contentType := ctx.Response().Header().Get("Content-Type")
// Ignore API requests
if strings.HasPrefix(ctx.URI(), "/api/") {
if !strings.HasPrefix(contentType, "text/html") {
return
}