MCPcopy Create free account
hub / github.com/aptly-dev/aptly / locationConstraint

Function locationConstraint

s3/server_test.go:699–712  ·  view source on GitHub ↗

locationConstraint parses the request body (if present). If there is no body, an empty string will be returned.

(a *action)

Source from the content-addressed store, hash-verified

697// locationConstraint parses the <CreateBucketConfiguration /> request body (if present).
698// If there is no body, an empty string will be returned.
699func locationConstraint(a *action) string {
700 var body bytes.Buffer
701 if _, err := io.Copy(&body, a.req.Body); err != nil {
702 fatalError(400, "InvalidRequest", "%v", err.Error())
703 }
704 if body.Len() == 0 {
705 return ""
706 }
707 var loc CreateBucketConfiguration
708 if err := xml.NewDecoder(&body).Decode(&loc); err != nil {
709 fatalError(400, "InvalidRequest", "%v", err.Error())
710 }
711 return loc.LocationConstraint
712}

Callers 1

putMethod · 0.85

Calls 5

fatalErrorFunction · 0.85
CopyMethod · 0.45
ErrorMethod · 0.45
LenMethod · 0.45
DecodeMethod · 0.45

Tested by

no test coverage detected