Skip to content

Commit

Permalink
tmp2
Browse files Browse the repository at this point in the history
  • Loading branch information
zetaab committed Oct 25, 2023
1 parent 57ff2c2 commit 3b2d179
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions header.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func init() {

func main() {
handler.HandleRequestFn = mw.handleRequest
handler.HandleResponseFn = mw.handleResponse
//handler.HandleResponseFn = mw.handleResponse
}

// handleRequest implements a simple request middleware.
Expand All @@ -44,10 +44,7 @@ func (mw *Middleware) handleRequest(req api.Request, resp api.Response) (next bo
}
// proceed to the next handler on the host.
next = true
return
}

// handleResponse implements a simple response middleware.
func (mw *Middleware) handleResponse(reqCtx uint32, req api.Request, resp api.Response, _ bool) {
handler.Host.Log(api.LogLevelInfo, fmt.Sprintf("request took %v %v [%s] %s", time.Since(mw.Start), req.Headers().GetAll("host"), req.GetMethod(), req.GetURI()))
resp.Headers().Add("Set-Cookie", "a=b; Path=/; Domain=example.com; Secure; HttpOnly; SameSite=Strict")
return
}
Binary file modified header.wasm
Binary file not shown.

0 comments on commit 3b2d179

Please sign in to comment.