Skip to content

Commit 324a193

Browse files
authored
Merge pull request #4 from serverless-tencent/fix_cosLifecycle
fix: cos lifecycle
2 parents 461754a + 62f027e commit 324a193

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/baas/cos/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class Cos {
230230
this.cosClient.putBucketLifecycle.bind(this.cosClient)
231231
)
232232
try {
233-
await setLifecycleHandler(setLifecycleParams)
233+
await setLifecycleHandler(JSON.parse(JSON.stringify(setLifecycleParams)))
234234
} catch (e) {
235235
throw new Error(JSON.stringify(e))
236236
}

src/baas/cos/index.test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ class ClientTest {
1818
key: 'test',
1919
value: 'abcd'
2020
}
21-
]
21+
],
22+
rules: [
23+
{
24+
status: 'Enabled',
25+
id: 'deleteObject',
26+
filter: '',
27+
expiration: { days: '10' },
28+
abortIncompleteMultipartUpload: { daysAfterInitiation: '10' }
29+
}
30+
],
2231
}
2332
const result = await cos.deploy(cosDemo)
2433
console.log(JSON.stringify(result))

0 commit comments

Comments
 (0)