Refactor request guard to include page backend script execution
This commit is contained in:
parent
67ad169bf5
commit
ddb337847e
1 changed files with 3 additions and 0 deletions
|
|
@ -311,6 +311,9 @@ func (r *Request) Guard(c *core.Cache) (int, error) {
|
||||||
if c.GuardRedirect != "" {
|
if c.GuardRedirect != "" {
|
||||||
redirect := c.GuardRedirect
|
redirect := c.GuardRedirect
|
||||||
data := core.Data{}
|
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 != "" {
|
if c.Data != "" {
|
||||||
data, err = r.Request.ExecString(c.Data)
|
data, err = r.Request.ExecString(c.Data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue