mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
bf9ab360bd
This utilizes the referrer query parameters instead of current request query parameters for logging the requested URI and method. Minor performance improvements to header peek/sets.
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package middlewares
|
|
|
|
import (
|
|
"github.com/valyala/fasthttp"
|
|
)
|
|
|
|
var (
|
|
headerXForwardedProto = []byte(fasthttp.HeaderXForwardedProto)
|
|
headerXForwardedHost = []byte(fasthttp.HeaderXForwardedHost)
|
|
headerXForwardedFor = []byte(fasthttp.HeaderXForwardedFor)
|
|
headerXRequestedWith = []byte(fasthttp.HeaderXRequestedWith)
|
|
headerAccept = []byte(fasthttp.HeaderAccept)
|
|
|
|
headerXForwardedURI = []byte("X-Forwarded-URI")
|
|
headerXOriginalURL = []byte("X-Original-URL")
|
|
headerXForwardedMethod = []byte("X-Forwarded-Method")
|
|
)
|
|
|
|
const (
|
|
headerValueXRequestedWithXHR = "XMLHttpRequest"
|
|
contentTypeApplicationJSON = "application/json"
|
|
contentTypeTextHTML = "text/html"
|
|
)
|
|
|
|
var okMessageBytes = []byte("{\"status\":\"OK\"}")
|
|
|
|
const (
|
|
messageOperationFailed = "Operation failed"
|
|
messageIdentityVerificationTokenAlreadyUsed = "The identity verification token has already been used"
|
|
messageIdentityVerificationTokenHasExpired = "The identity verification token has expired"
|
|
)
|
|
|
|
var protoHostSeparator = []byte("://")
|
|
var validOverrideAssets = []string{"favicon.ico", "logo.png"}
|