Updated userinfo middleware
This commit is contained in:
parent
9b0d20164f
commit
39e445bf71
@ -19,12 +19,9 @@ func UserInfo() aero.Middleware {
|
|||||||
next()
|
next()
|
||||||
|
|
||||||
// Ignore non-HTML requests
|
// Ignore non-HTML requests
|
||||||
if aero.IsMediaType(ctx.Response().Header().Get("Content-Type")) {
|
contentType := ctx.Response().Header().Get("Content-Type")
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ignore API requests
|
if !strings.HasPrefix(contentType, "text/html") {
|
||||||
if strings.HasPrefix(ctx.URI(), "/api/") {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user