示例#1
0
func testHandler(req *web.Request) {
	req.ParseForm(1000)
	header := make(web.Header)
	p := req.Param.Get("panic")
	if p == "before" {
		panic("before")
	}
	if s := req.Param.Get("cl"); s != "" {
		header.Set(web.HeaderContentLength, s)
	}
	w := req.Responder.Respond(web.StatusOK, header)
	if s := req.Param.Get("w"); s != "" {
		w.Write([]byte(s))
	}
	if p == "after" {
		panic("after")
	}
}