MCPcopy Create free account
hub / github.com/cool-sun/cloudApp / exist

Function exist

controller/artifacthub.go:23–30  ·  view source on GitHub ↗

因为本站的静态文件地址前缀是/static, artifacthub的静态文件地址前缀也是/static, 所以需要区分是访问本站的静态资源还是artifacthub的静态资源 判断要访问的静态文件在当前站有没有,如果有就直接返回,否则就转发到artifacthub。 上述判断方法简单,但是有可能存在一些特殊情况会出错,比如要访问artifacthub的某个静态文件资源在本站存在同名的,就会返回本站的资源了 后续如果有需要可以从http请求头中寻找差异信息来判断是否转发请求

(path string)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

StaticFunction · 0.85

Calls 1

ContainsMethod · 0.80

Tested by

no test coverage detected