mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 16:00:25 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			721 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			721 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package checkpoints
 | 
						|
 | 
						|
import (
 | 
						|
	"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
 | 
						|
	"github.com/iwind/TeaGo/maps"
 | 
						|
	"strings"
 | 
						|
)
 | 
						|
 | 
						|
type RequestHeaderCheckpoint struct {
 | 
						|
	Checkpoint
 | 
						|
}
 | 
						|
 | 
						|
func (this *RequestHeaderCheckpoint) RequestValue(req requests.Request, param string, options maps.Map) (value interface{}, sysErr error, userErr error) {
 | 
						|
	v, found := req.WAFRaw().Header[param]
 | 
						|
	if !found {
 | 
						|
		value = ""
 | 
						|
		return
 | 
						|
	}
 | 
						|
	value = strings.Join(v, ";")
 | 
						|
	return
 | 
						|
}
 | 
						|
 | 
						|
func (this *RequestHeaderCheckpoint) ResponseValue(req requests.Request, resp *requests.Response, param string, options maps.Map) (value interface{}, sysErr error, userErr error) {
 | 
						|
	if this.IsRequest() {
 | 
						|
		return this.RequestValue(req, param, options)
 | 
						|
	}
 | 
						|
	return
 | 
						|
}
 |