MCPcopy
hub / github.com/NVIDIA/aistore / PropToHeader

Function PropToHeader

cmn/common.go:57–67  ·  view source on GitHub ↗

config: path, load, save // PropToHeader converts a property full name to an HTTP header tag name

(prop string)

Source from the content-addressed store, hash-verified

55
56// PropToHeader converts a property full name to an HTTP header tag name
57func PropToHeader(prop string) string {
58 if strings.HasPrefix(prop, apc.HeaderPrefix) {
59 return prop
60 }
61 if prop[0] == '.' || prop[0] == '_' {
62 prop = prop[1:]
63 }
64 prop = strings.ReplaceAll(prop, ".", "-")
65 prop = strings.ReplaceAll(prop, "_", "-")
66 return apc.HeaderPrefix + prop
67}
68
69// promoted destination object's name
70func PromotedObjDstName(objfqn, dirfqn, givenObjName string) (objName string, err error) {

Callers 2

HeadObjectFunction · 0.92
headObjectMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected