Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
16245dbd
Commit
16245dbd
authored
Jun 15, 2016
by
Jeromy Johnson
Committed by
GitHub
Jun 15, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2778 from ipfs/feature/CORS-on-gateway-by-default
Add CORS headers to Read Only Gateway Default config
parents
323441d7
c0393383
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
repo/config/init.go
repo/config/init.go
+5
-0
test/sharness/t0112-gateway-cors.sh
test/sharness/t0112-gateway-cors.sh
+0
-4
No files found.
repo/config/init.go
View file @
16245dbd
...
...
@@ -62,6 +62,11 @@ func Init(out io.Writer, nBitsForKeypair int) (*Config, error) {
RootRedirect
:
""
,
Writable
:
false
,
PathPrefixes
:
[]
string
{},
HTTPHeaders
:
map
[
string
][]
string
{
"Access-Control-Allow-Origin"
:
[]
string
{
"*"
},
"Access-Control-Allow-Methods"
:
[]
string
{
"GET"
},
"Access-Control-Allow-Headers"
:
[]
string
{
"X-Requested-With"
},
},
},
}
...
...
test/sharness/t0112-gateway-cors.sh
View file @
16245dbd
...
...
@@ -7,10 +7,6 @@
test_description
=
"Test HTTP Gateway CORS Support"
test_config_ipfs_cors_headers
()
{
ipfs config
--json
Gateway.HTTPHeaders.Access-Control-Allow-Origin
'["*"]'
ipfs config
--json
Gateway.HTTPHeaders.Access-Control-Allow-Methods
'["PUT", "GET", "POST"]'
ipfs config
--json
Gateway.HTTPHeaders.Access-Control-Allow-Headers
'["X-Requested-With"]'
ipfs config
--json
API.HTTPHeaders.Access-Control-Allow-Origin
'["*"]'
ipfs config
--json
API.HTTPHeaders.Access-Control-Allow-Methods
'["PUT", "GET", "POST"]'
ipfs config
--json
API.HTTPHeaders.Access-Control-Allow-Headers
'["X-Requested-With"]'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment