MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / ShouldProxy

Function ShouldProxy

server/common/check.go:92–100  ·  view source on GitHub ↗

ShouldProxy TODO need optimize when should be proxy? 1. config.MustProxy() 2. storage.WebProxy 3. proxy_types

(storage driver.Driver, filename string)

Source from the content-addressed store, hash-verified

90// 2. storage.WebProxy
91// 3. proxy_types
92func ShouldProxy(storage driver.Driver, filename string) bool {
93 if storage.Config().MustProxy() || storage.GetStorage().WebProxy {
94 return true
95 }
96 if utils.SliceContains(conf.SlicesMap[conf.ProxyTypes], utils.Ext(filename)) {
97 return true
98 }
99 return false
100}

Callers 10

LinkMethod · 0.92
linkMethod · 0.92
extractMethod · 0.92
linkMethod · 0.92
directObjectURLFunction · 0.92
buildFSLinkInfoFunction · 0.92
ArchiveDownFunction · 0.92
SharingDownFunction · 0.92
SharingArchiveExtractFunction · 0.92
DownFunction · 0.92

Calls 5

SliceContainsFunction · 0.92
ExtFunction · 0.92
MustProxyMethod · 0.80
ConfigMethod · 0.65
GetStorageMethod · 0.65

Tested by

no test coverage detected