Merge pull request #752 from trheyi/main

Refactor request guard to include page backend script execution
This commit is contained in:
Max 2024-09-24 08:01:22 +08:00 committed by GitHub
commit 0ea400965d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -311,6 +311,9 @@ func (r *Request) Guard(c *core.Cache) (int, error) {
if c.GuardRedirect != "" {
redirect := c.GuardRedirect
data := core.Data{}
// Here may have a security issue, should be refector, in the future.
// Copy the script pointer to the request For page backend script execution
r.Request.Script = c.Script
if c.Data != "" {
data, err = r.Request.ExecString(c.Data)
if err != nil {