Skip to content

Commit

Permalink
fix: cors config
Browse files Browse the repository at this point in the history
  • Loading branch information
yugasun committed Apr 15, 2021
1 parent 1d225b8 commit 2a061ed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
9 changes: 4 additions & 5 deletions docs/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,15 @@ inputs:
grantWrite: id="1234567"
grantFullControl: id="1234567"
cors:
- id: abc
maxAgeSeconds: '10'
- maxAgeSeconds: 0
allowedMethods:
- GET
allowedOrigins:
- https://tencent.com
- '*'
allowedHeaders:
- FIRST_ALLOWED_HEADER
- '*'
exposeHeaders:
- FIRST_EXPOSED_HEADER
- ''
tags:
- key: abc
value: xyz
Expand Down
2 changes: 1 addition & 1 deletion serverless.component.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cos
version: 0.2.2
version: 0.2.3
author: 'Tencent Cloud, Inc.'
org: 'Tencent Cloud, Inc.'
description: Deploy Tencent COS.
Expand Down
4 changes: 4 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ async function formatInputs(instance, inputs) {
}
}

if (inputs.cors) {
formatedInputs.cors = inputs.cors
}

if (inputs.website === true) {
const websiteConfig = inputs.websiteConfig || {}
formatedInputs.ignoreHtmlExt = websiteConfig.ignoreHtmlExt
Expand Down

0 comments on commit 2a061ed

Please sign in to comment.