2023-01-25 09:36:40 +00:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/valyala/fasthttp"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
testRequestMethods = []string{
|
|
|
|
fasthttp.MethodOptions, fasthttp.MethodHead, fasthttp.MethodGet,
|
|
|
|
fasthttp.MethodDelete, fasthttp.MethodPatch, fasthttp.MethodPost,
|
|
|
|
fasthttp.MethodPut, fasthttp.MethodConnect, fasthttp.MethodTrace,
|
|
|
|
}
|
|
|
|
|
|
|
|
testXHR = map[string]bool{
|
|
|
|
testWithoutAccept: false,
|
|
|
|
testWithXHRHeader: true,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
testXOriginalMethod = "X-Original-Method"
|
2023-04-17 23:53:26 +00:00
|
|
|
testXOriginalUrl = "X-Original-URL"
|
2023-01-25 09:36:40 +00:00
|
|
|
testBypass = "bypass"
|
|
|
|
testWithoutAccept = "WithoutAccept"
|
|
|
|
testWithXHRHeader = "WithXHRHeader"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
testInactivity = time.Second * 10
|
|
|
|
testRedirectionURL = "http://redirection.local"
|
|
|
|
testUsername = "john"
|
|
|
|
exampleDotCom = "example.com"
|
|
|
|
)
|