MCPcopy
hub / github.com/cubefs/cubefs / ValidateCacheControl

Function ValidateCacheControl

objectnode/util.go:310–319  ·  view source on GitHub ↗
(cacheControl string)

Source from the content-addressed store, hash-verified

308)
309
310func ValidateCacheControl(cacheControl string) bool {
311 cacheDirs := strings.Split(cacheControl, ",")
312 for _, dir := range cacheDirs {
313 if !contains(cacheControlDir, dir) && !maxAgeRegexp.MatchString(dir) {
314 log.LogErrorf("invalid cache-control directive: %v", dir)
315 return false
316 }
317 }
318 return true
319}
320
321func ValidateCacheExpires(expires string) bool {
322 var err error

Callers 5

getObjectHandlerMethod · 0.85
copyObjectHandlerMethod · 0.85
putObjectHandlerMethod · 0.85
postObjectHandlerMethod · 0.85

Calls 3

LogErrorfFunction · 0.92
containsFunction · 0.70
SplitMethod · 0.65

Tested by

no test coverage detected