mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-25 02:09:01 +02:00
refactor(rules): rename Static and Returning commands into Terminating and NonTerminating commands
This commit is contained in:
@@ -41,14 +41,14 @@ var modFields = map[string]struct {
|
||||
builder: func(args any) *FieldHandler {
|
||||
k, v := args.(*StrTuple).Unpack()
|
||||
return &FieldHandler{
|
||||
set: StaticCommand(func(w http.ResponseWriter, r *http.Request) {
|
||||
set: NonTerminatingCommand(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header()[k] = []string{v}
|
||||
}),
|
||||
add: StaticCommand(func(w http.ResponseWriter, r *http.Request) {
|
||||
add: NonTerminatingCommand(func(w http.ResponseWriter, r *http.Request) {
|
||||
h := w.Header()
|
||||
h[k] = append(h[k], v)
|
||||
}),
|
||||
remove: StaticCommand(func(w http.ResponseWriter, r *http.Request) {
|
||||
remove: NonTerminatingCommand(func(w http.ResponseWriter, r *http.Request) {
|
||||
delete(w.Header(), k)
|
||||
}),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user