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
8bf4d680
Unverified
Commit
8bf4d680
authored
Oct 03, 2018
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add datasource proxy test to verify trailing slashes are forwarded
parent
b4fad40c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
pkg/api/pluginproxy/ds_proxy_test.go
+17
-0
No files found.
pkg/api/pluginproxy/ds_proxy_test.go
View file @
8bf4d680
...
...
@@ -374,6 +374,23 @@ func TestDSRouteRule(t *testing.T) {
})
})
Convey
(
"When proxying a custom datasource"
,
func
()
{
plugin
:=
&
plugins
.
DataSourcePlugin
{}
ds
:=
&
m
.
DataSource
{
Type
:
"custom-datasource"
,
Url
:
"http://host/root/"
,
}
ctx
:=
&
m
.
ReqContext
{}
proxy
:=
NewDataSourceProxy
(
ds
,
plugin
,
ctx
,
"/path/to/folder/"
)
req
,
err
:=
http
.
NewRequest
(
http
.
MethodGet
,
"http://grafana.com/sub"
,
nil
)
So
(
err
,
ShouldBeNil
)
proxy
.
getDirector
()(
req
)
Convey
(
"Shoudl keep user request (including trailing slash)"
,
func
()
{
So
(
req
.
URL
.
String
(),
ShouldEqual
,
"http://host/root/path/to/folder/"
)
})
})
})
}
...
...
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