Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ef2f8d0

Browse files
authoredDec 18, 2023
Add support to private network CORS (#873)
1 parent fb135b0 commit ef2f8d0

File tree

10 files changed

+83
-74
lines changed

10 files changed

+83
-74
lines changed
 

‎.licenses/arduino-create-agent/go/github.com/andela/gin-cors.dep.yml renamed to ‎.licenses/arduino-create-agent/go/github.com/gin-contrib/cors.dep.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
2-
name: github.com/andela/gin-cors
3-
version: v0.0.0-20160928171741-e8c3436a37e2
2+
name: github.com/gin-contrib/cors
3+
version: v1.5.0
44
type: go
5-
summary: This code implements the flow chart that can be found here.
6-
homepage: https://pkg.go.dev/github.com/andela/gin-cors
5+
summary:
6+
homepage: https://pkg.go.dev/github.com/gin-contrib/cors
77
license: mit
88
licenses:
99
- sources: LICENSE
10-
text: |+
11-
The MIT License (MIT)
10+
text: |
11+
MIT License
1212
13-
Copyright (c) 2015 Jamie Stackhouse
13+
Copyright (c) 2016 Gin-Gonic
1414
1515
Permission is hereby granted, free of charge, to any person obtaining a copy
1616
of this software and associated documentation files (the "Software"), to deal
@@ -29,7 +29,4 @@ licenses:
2929
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3030
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3131
SOFTWARE.
32-
33-
- sources: README.md
34-
text: The code is licensed under the MIT License. See LICENSE file for more details.
3532
notices: []

‎.licenses/arduino-create-agent/go/github.com/go-playground/validator/v10.dep.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: github.com/go-playground/validator/v10
3-
version: v10.14.0
3+
version: v10.15.5
44
type: go
55
summary: Package validator implements value validations for structs and individual
66
fields based on tags.
@@ -35,4 +35,3 @@ licenses:
3535
text: Distributed under MIT License, please see license file within the code for
3636
more details.
3737
notices: []
38-
...

‎.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2.dep.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
---
22
name: github.com/pelletier/go-toml/v2
3-
version: v2.0.8
3+
version: v2.1.0
44
type: go
55
summary: Package toml is a library to read and write TOML documents.
66
homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2
7-
license: mit
7+
license: other
88
licenses:
99
- sources: LICENSE
1010
text: |
1111
The MIT License (MIT)
1212
13-
Copyright (c) 2013 - 2022 Thomas Pelletier, Eric Anderton
13+
go-toml v2
14+
Copyright (c) 2021 - 2023 Thomas Pelletier
1415
1516
Permission is hereby granted, free of charge, to any person obtaining a copy
1617
of this software and associated documentation files (the "Software"), to deal

‎.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/characters.dep.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
---
22
name: github.com/pelletier/go-toml/v2/internal/characters
3-
version: v2.0.8
3+
version: v2.1.0
44
type: go
5-
summary:
5+
summary:
66
homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/internal/characters
7-
license: mit
7+
license: other
88
licenses:
9-
- sources: v2@v2.0.8/LICENSE
9+
- sources: v2@v2.1.0/LICENSE
1010
text: |
1111
The MIT License (MIT)
1212
13-
Copyright (c) 2013 - 2022 Thomas Pelletier, Eric Anderton
13+
go-toml v2
14+
Copyright (c) 2021 - 2023 Thomas Pelletier
1415
1516
Permission is hereby granted, free of charge, to any person obtaining a copy
1617
of this software and associated documentation files (the "Software"), to deal
@@ -29,6 +30,6 @@ licenses:
2930
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3031
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3132
SOFTWARE.
32-
- sources: v2@v2.0.8/README.md
33+
- sources: v2@v2.1.0/README.md
3334
text: The MIT License (MIT). Read [LICENSE](LICENSE).
3435
notices: []

‎.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/danger.dep.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
---
22
name: github.com/pelletier/go-toml/v2/internal/danger
3-
version: v2.0.8
3+
version: v2.1.0
44
type: go
5-
summary:
5+
summary:
66
homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/internal/danger
7-
license: mit
7+
license: other
88
licenses:
9-
- sources: v2@v2.0.8/LICENSE
9+
- sources: v2@v2.1.0/LICENSE
1010
text: |
1111
The MIT License (MIT)
1212
13-
Copyright (c) 2013 - 2022 Thomas Pelletier, Eric Anderton
13+
go-toml v2
14+
Copyright (c) 2021 - 2023 Thomas Pelletier
1415
1516
Permission is hereby granted, free of charge, to any person obtaining a copy
1617
of this software and associated documentation files (the "Software"), to deal
@@ -29,6 +30,6 @@ licenses:
2930
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3031
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3132
SOFTWARE.
32-
- sources: v2@v2.0.8/README.md
33+
- sources: v2@v2.1.0/README.md
3334
text: The MIT License (MIT). Read [LICENSE](LICENSE).
3435
notices: []

‎.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/tracker.dep.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
---
22
name: github.com/pelletier/go-toml/v2/internal/tracker
3-
version: v2.0.8
3+
version: v2.1.0
44
type: go
5-
summary:
5+
summary:
66
homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/internal/tracker
7-
license: mit
7+
license: other
88
licenses:
9-
- sources: v2@v2.0.8/LICENSE
9+
- sources: v2@v2.1.0/LICENSE
1010
text: |
1111
The MIT License (MIT)
1212
13-
Copyright (c) 2013 - 2022 Thomas Pelletier, Eric Anderton
13+
go-toml v2
14+
Copyright (c) 2021 - 2023 Thomas Pelletier
1415
1516
Permission is hereby granted, free of charge, to any person obtaining a copy
1617
of this software and associated documentation files (the "Software"), to deal
@@ -29,6 +30,6 @@ licenses:
2930
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3031
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3132
SOFTWARE.
32-
- sources: v2@v2.0.8/README.md
33+
- sources: v2@v2.1.0/README.md
3334
text: The MIT License (MIT). Read [LICENSE](LICENSE).
3435
notices: []

‎.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/unstable.dep.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
---
22
name: github.com/pelletier/go-toml/v2/unstable
3-
version: v2.0.8
3+
version: v2.1.0
44
type: go
55
summary: Package unstable provides APIs that do not meet the backward compatibility
66
guarantees yet.
77
homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/unstable
8-
license: mit
8+
license: other
99
licenses:
10-
- sources: v2@v2.0.8/LICENSE
10+
- sources: v2@v2.1.0/LICENSE
1111
text: |
1212
The MIT License (MIT)
1313
14-
Copyright (c) 2013 - 2022 Thomas Pelletier, Eric Anderton
14+
go-toml v2
15+
Copyright (c) 2021 - 2023 Thomas Pelletier
1516
1617
Permission is hereby granted, free of charge, to any person obtaining a copy
1718
of this software and associated documentation files (the "Software"), to deal
@@ -30,6 +31,6 @@ licenses:
3031
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3132
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3233
SOFTWARE.
33-
- sources: v2@v2.0.8/README.md
34+
- sources: v2@v2.1.0/README.md
3435
text: The MIT License (MIT). Read [LICENSE](LICENSE).
3536
notices: []

‎go.mod

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ go 1.21
44

55
require (
66
github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c
7-
github.com/andela/gin-cors v0.0.0-20160928171741-e8c3436a37e2
87
github.com/arduino/arduino-cli v0.0.0-20230630155703-fe6d7499eb5e
98
github.com/arduino/go-paths-helper v1.10.1
109
github.com/blang/semver v3.5.1+incompatible
1110
github.com/codeclysm/extract/v3 v3.1.1
1211
github.com/getlantern/systray v1.1.0
12+
github.com/gin-contrib/cors v1.5.0
1313
github.com/gin-gonic/gin v1.9.1
1414
github.com/go-ini/ini v1.62.0
1515
github.com/googollee/go-socket.io v0.0.0-20181101151912-c8aeb1ed9b49
@@ -28,8 +28,9 @@ require (
2828

2929
require (
3030
github.com/AnatolyRugalev/goregen v0.1.0 // indirect
31-
github.com/bytedance/sonic v1.9.1 // indirect
32-
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
31+
github.com/bytedance/sonic v1.10.1 // indirect
32+
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
33+
github.com/chenzhuoyu/iasm v0.9.0 // indirect
3334
github.com/cloudflare/circl v1.3.3 // indirect
3435
github.com/creack/goselect v0.1.2 // indirect
3536
github.com/davecgh/go-spew v1.1.1 // indirect
@@ -45,7 +46,7 @@ require (
4546
github.com/go-chi/chi/v5 v5.0.10 // indirect
4647
github.com/go-playground/locales v0.14.1 // indirect
4748
github.com/go-playground/universal-translator v0.18.1 // indirect
48-
github.com/go-playground/validator/v10 v10.14.0 // indirect
49+
github.com/go-playground/validator/v10 v10.15.5 // indirect
4950
github.com/go-stack/stack v1.8.0 // indirect
5051
github.com/goccy/go-json v0.10.2 // indirect
5152
github.com/google/go-cmp v0.5.9 // indirect
@@ -57,7 +58,7 @@ require (
5758
github.com/juju/errors v0.0.0-20200330140219-3fe23663418f // indirect
5859
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
5960
github.com/klauspost/compress v1.15.13 // indirect
60-
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
61+
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
6162
github.com/kr/binarydist v0.1.0 // indirect
6263
github.com/leodido/go-urn v1.2.4 // indirect
6364
github.com/leonelquinteros/gotext v1.4.0 // indirect
@@ -66,14 +67,14 @@ require (
6667
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6768
github.com/modern-go/reflect2 v1.0.2 // indirect
6869
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect
69-
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
70+
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
7071
github.com/pmezard/go-difflib v1.0.0 // indirect
7172
github.com/sergi/go-diff v1.3.1 // indirect
7273
github.com/smartystreets/goconvey v1.6.4 // indirect
7374
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
7475
github.com/ugorji/go v1.1.6 // indirect
7576
github.com/ulikunitz/xz v0.5.11 // indirect
76-
golang.org/x/arch v0.3.0 // indirect
77+
golang.org/x/arch v0.5.0 // indirect
7778
golang.org/x/crypto v0.16.0 // indirect
7879
golang.org/x/mod v0.14.0 // indirect
7980
golang.org/x/net v0.19.0 // indirect

‎go.sum

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ github.com/AnatolyRugalev/goregen v0.1.0 h1:xrdXkLaskMnbxW0x4FWNj2yoednv0X2bcTBW
22
github.com/AnatolyRugalev/goregen v0.1.0/go.mod h1:sVlY1tjcirqLBRZnCcIq1+7/Lwmqz5g7IK8AStjOVzI=
33
github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c h1:kMFnB0vCcX7IL/m9Y5LO+KQYv+t1CQOiFe6+SV2J7bE=
44
github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
5-
github.com/andela/gin-cors v0.0.0-20160928171741-e8c3436a37e2 h1:CEix/eilscZqWgZKpY1VU0VTxOv+jV6NVgJEZ/hMBVs=
6-
github.com/andela/gin-cors v0.0.0-20160928171741-e8c3436a37e2/go.mod h1:qLg54VlozD6sRu86y3SzM1iybe6G2eaoZGKuGdxSsdc=
75
github.com/arduino/arduino-cli v0.0.0-20230630155703-fe6d7499eb5e h1:gmlrLhRuuIY/hw9EvvLCUvMDXMFZBtIVW29tMYGchkw=
86
github.com/arduino/arduino-cli v0.0.0-20230630155703-fe6d7499eb5e/go.mod h1:2E4tNTNWuf4CtG/pF/Y+fRO6JXxVEcbDDStjZYtMK2c=
97
github.com/arduino/go-paths-helper v1.10.1 h1:j8InnhLrSeoPiOvTnZL0XMFt7l407ciTBJJJs7W9bs4=
@@ -12,11 +10,15 @@ github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdn
1210
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
1311
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
1412
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
15-
github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s=
16-
github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
13+
github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM=
14+
github.com/bytedance/sonic v1.10.1 h1:7a1wuFXL1cMy7a3f7/VFcEtriuXQnUBhtoVfOZiaysc=
15+
github.com/bytedance/sonic v1.10.1/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4=
1716
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
18-
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams=
1917
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
18+
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0=
19+
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA=
20+
github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo=
21+
github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog=
2022
github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs=
2123
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
2224
github.com/codeclysm/extract/v3 v3.1.1 h1:iHZtdEAwSTqPrd+1n4jfhr1qBhUWtHlMTjT90+fJVXg=
@@ -44,6 +46,8 @@ github.com/getlantern/ops v0.0.0-20190325191751-d70cb0d6f85f h1:wrYrQttPS8FHIRSl
4446
github.com/getlantern/ops v0.0.0-20190325191751-d70cb0d6f85f/go.mod h1:D5ao98qkA6pxftxoqzibIBBrLSUli+kYnJqrgBf9cIA=
4547
github.com/getlantern/systray v1.1.0 h1:U0wCEqseLi2ok1fE6b88gJklzriavPJixZysZPkZd/Y=
4648
github.com/getlantern/systray v1.1.0/go.mod h1:AecygODWIsBquJCJFop8MEQcJbWFfw/1yWbVabNgpCM=
49+
github.com/gin-contrib/cors v1.5.0 h1:DgGKV7DDoOn36DFkNtbHrjoRiT5ExCe+PC9/xp7aKvk=
50+
github.com/gin-contrib/cors v1.5.0/go.mod h1:TvU7MAZ3EwrPLI2ztzTt3tqgvBCq+wn8WpZmfADjupI=
4751
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
4852
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
4953
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
@@ -58,8 +62,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
5862
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
5963
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
6064
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
61-
github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js=
62-
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
65+
github.com/go-playground/validator/v10 v10.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24=
66+
github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
6367
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
6468
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
6569
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
@@ -96,11 +100,14 @@ github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALr
96100
github.com/klauspost/compress v1.15.13 h1:NFn1Wr8cfnenSJSA46lLq4wHCcBzKTSjnBIexDMMOV0=
97101
github.com/klauspost/compress v1.15.13/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
98102
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
99-
github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk=
100-
github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
103+
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
104+
github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
105+
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
101106
github.com/kr/binarydist v0.1.0 h1:6kAoLA9FMMnNGSehX0s1PdjbEaACznAv/W219j2uvyo=
102107
github.com/kr/binarydist v0.1.0/go.mod h1:DY7S//GCoz1BCd0B0EVrinCKAZN3pXe+MDaIZbXQVgM=
103108
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
109+
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
110+
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
104111
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
105112
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
106113
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -124,16 +131,16 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
124131
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
125132
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
126133
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
127-
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
128-
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
129134
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw=
130135
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0=
131-
github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
132-
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
136+
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
137+
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
133138
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
134139
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
135140
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
136141
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
142+
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
143+
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
137144
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
138145
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
139146
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
@@ -154,7 +161,6 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
154161
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
155162
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
156163
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
157-
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
158164
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
159165
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
160166
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
@@ -171,8 +177,8 @@ go.bug.st/serial v1.6.1/go.mod h1:UABfsluHAiaNI+La2iESysd9Vetq7VRdpxvjx7CmmOE=
171177
goa.design/goa/v3 v3.14.0 h1:Ymm6hDyxWFiYclVHcMs1cl7vgSHiYLSIweHE74EusoA=
172178
goa.design/goa/v3 v3.14.0/go.mod h1:QYVl5438/92SiqcIzYpIwz10QAocAJeacQu+FO0lTXQ=
173179
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
174-
golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k=
175-
golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
180+
golang.org/x/arch v0.5.0 h1:jpGode6huXQxcskEIpOCvrU+tzo81b6+oFLUYXWtH/Y=
181+
golang.org/x/arch v0.5.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
176182
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
177183
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
178184
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
@@ -202,7 +208,6 @@ golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7w
202208
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
203209
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
204210
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
205-
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
206211
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
207212
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
208213
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -238,8 +243,8 @@ google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs
238243
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
239244
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
240245
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
241-
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
242-
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
246+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
247+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
243248
gopkg.in/inconshreveable/go-update.v0 v0.0.0-20150814200126-d8b0b1d421aa h1:drvf2JoUL1fz3ttkGNkw+rf3kZa2//7XkYGpSO4NHNA=
244249
gopkg.in/inconshreveable/go-update.v0 v0.0.0-20150814200126-d8b0b1d421aa/go.mod h1:tuNm0ntQ7IH9VSA39XxzLMpee5c2DwgIbjD4x3ydo8Y=
245250
gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU=
@@ -252,4 +257,5 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
252257
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
253258
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
254259
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
260+
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
255261
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=

‎main.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ import (
2929
"runtime"
3030
"runtime/debug"
3131
"strconv"
32-
"strings"
3332
"time"
3433

35-
cors "github.com/andela/gin-cors"
3634
cert "github.com/arduino/arduino-create-agent/certificates"
3735
"github.com/arduino/arduino-create-agent/config"
3836
"github.com/arduino/arduino-create-agent/globals"
@@ -42,6 +40,7 @@ import (
4240
"github.com/arduino/arduino-create-agent/updater"
4341
v2 "github.com/arduino/arduino-create-agent/v2"
4442
paths "github.com/arduino/go-paths-helper"
43+
cors "github.com/gin-contrib/cors"
4544
"github.com/gin-gonic/gin"
4645
"github.com/go-ini/ini"
4746
log "github.com/sirupsen/logrus"
@@ -373,14 +372,16 @@ func loop() {
373372
extraOrigins = append(extraOrigins, "https://127.0.0.1:"+port)
374373
}
375374

376-
r.Use(cors.Middleware(cors.Config{
377-
Origins: *origins + ", " + strings.Join(extraOrigins, ", "),
378-
Methods: "GET, PUT, POST, DELETE",
379-
RequestHeaders: "Origin, Authorization, Content-Type",
380-
ExposedHeaders: "",
381-
MaxAge: 50 * time.Second,
382-
Credentials: true,
383-
ValidateHeaders: false,
375+
allowOrigings := []string{*origins}
376+
allowOrigings = append(allowOrigings, extraOrigins...)
377+
r.Use(cors.New(cors.Config{
378+
AllowOrigins: allowOrigings,
379+
AllowMethods: []string{"PUT", "GET", "POST", "DELETE"},
380+
AllowHeaders: []string{"Origin", "Authorization", "Content-Type"},
381+
ExposeHeaders: []string{},
382+
AllowCredentials: true,
383+
MaxAge: 50 * time.Second,
384+
AllowPrivateNetwork: true,
384385
}))
385386

386387
r.LoadHTMLFiles("templates/nofirefox.html")

0 commit comments

Comments
 (0)
Please sign in to comment.