gf icon indicating copy to clipboard operation
gf copied to clipboard

请问怎么使用中间间拦截 /static/20220826/xx.png 这样的请求?

Open g1012415019 opened this issue 2 years ago • 1 comments

请问怎么使用中间间拦截 /static/20220826/xx.png 这样的请求?

g1012415019 avatar Aug 30 '22 02:08 g1012415019

静态文件服务

func beforeServeHook(r *ghttp.Request) { glog.Debugf(r.GetCtx(), "beforeServeHook [is file:%v] URI:%s", r.IsFileRequest(), r.RequestURI) r.Response.CORSDefault() }

DGuang21 avatar Sep 05 '22 01:09 DGuang21

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.

zhonghuaxunGM avatar Oct 14 '22 10:10 zhonghuaxunGM