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
262e7812
Commit
262e7812
authored
10 years ago
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/corehttp: Added Suborigin header to gateway responses
parent
a7de81b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
core/corehttp/gateway_handler.go
core/corehttp/gateway_handler.go
+6
-0
No files found.
core/corehttp/gateway_handler.go
View file @
262e7812
...
...
@@ -193,6 +193,12 @@ func (i *gatewayHandler) getHandler(w http.ResponseWriter, r *http.Request) {
w
.
Header
()
.
Set
(
"X-IPFS-Path"
,
p
)
// Suborigin header, sandboxes apps from each other in the browser (even
// though they are served from the same gateway domain). NOTE: This is not
// yet widely supported by browsers.
pathRoot
:=
strings
.
SplitN
(
urlPath
,
"/"
,
4
)[
2
]
w
.
Header
()
.
Set
(
"Suborigin"
,
pathRoot
)
dr
,
err
:=
i
.
NewDagReader
(
nd
)
if
err
!=
nil
&&
err
!=
uio
.
ErrIsDir
{
// not a directory and still an error
...
...
This diff is collapsed.
Click to expand it.
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