gf
gf copied to clipboard
请问怎么使用中间间拦截 /static/20220826/xx.png 这样的请求?
请问怎么使用中间间拦截 /static/20220826/xx.png 这样的请求?
func beforeServeHook(r *ghttp.Request) { glog.Debugf(r.GetCtx(), "beforeServeHook [is file:%v] URI:%s", r.IsFileRequest(), r.RequestURI) r.Response.CORSDefault() }
Maybe you can use a simple and rude method. In Middlerwarehandler, get the uri and judge that the prefix is /static.
This issue is closed. If still have a question, plz let me known.