Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
1f2cba81
Commit
1f2cba81
authored
May 05, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'enforce-domain' of
https://github.com/gummiboll/grafana
parents
e458ca7b
2d7c7871
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
pkg/middleware/middleware.go
+10
-0
No files found.
pkg/middleware/middleware.go
View file @
1f2cba81
...
...
@@ -34,6 +34,16 @@ func GetContextHandler() macaron.Handler {
AllowAnonymous
:
false
,
}
h
:=
ctx
.
Req
.
Host
if
i
:=
strings
.
Index
(
h
,
":"
);
i
>=
0
{
h
=
h
[
:
i
]
}
if
!
strings
.
EqualFold
(
h
,
setting
.
Domain
)
{
ctx
.
Redirect
(
strings
.
TrimSuffix
(
setting
.
AppUrl
,
"/"
)
+
ctx
.
Req
.
RequestURI
,
301
)
return
}
// the order in which these are tested are important
// look for api key in Authorization header first
// then init session and look for userId in session
...
...
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