Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix add verify bucketLifecycle rule #437

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions oss/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ func verifyLifecycleRules(rules []LifecycleRule) error {
if rule.Status != "Enabled" && rule.Status != "Disabled" {
return fmt.Errorf("invalid rule, the value of status must be Enabled or Disabled")
}

if len(rule.Prefix) != 0 && rule.Prefix[0] == '/' {
return fmt.Errorf("invalid rule, the value of prefix can't start with /")
}
abortMPU := rule.AbortMultipartUpload
if abortMPU != nil {
if (abortMPU.Days != 0 && abortMPU.CreatedBeforeDate != "") || (abortMPU.Days == 0 && abortMPU.CreatedBeforeDate == "") {
Expand Down Expand Up @@ -1669,10 +1671,10 @@ type RegionInfoList struct {
Regions []RegionInfo `xml:"RegionInfo"`
}

//PutBucketResponseHeader define the xml of bucket's response header config
// PutBucketResponseHeader define the xml of bucket's response header config
type PutBucketResponseHeader ResponseHeaderXml

//GetBucketResponseHeaderResult define the xml of bucket's response header result
// GetBucketResponseHeaderResult define the xml of bucket's response header result
type GetBucketResponseHeaderResult ResponseHeaderXml

type ResponseHeaderXml struct {
Expand Down