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
b4b7156f
Commit
b4b7156f
authored
Dec 02, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(webdav): adds missing auth headers
closes #6779
parent
c206c043
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
pkg/components/imguploader/webdavuploader.go
+6
-4
No files found.
pkg/components/imguploader/webdavuploader.go
View file @
b4b7156f
...
...
@@ -7,7 +7,6 @@ import (
"net/http"
"net/url"
"path"
"time"
"github.com/grafana/grafana/pkg/util"
)
...
...
@@ -19,14 +18,17 @@ type WebdavUploader struct {
}
func
(
u
*
WebdavUploader
)
Upload
(
pa
string
)
(
string
,
error
)
{
client
:=
http
.
Client
{
Timeout
:
time
.
Duration
(
10
*
time
.
Second
)}
url
,
_
:=
url
.
Parse
(
u
.
url
)
url
.
Path
=
path
.
Join
(
url
.
Path
,
util
.
GetRandomString
(
20
)
+
".png"
)
imgData
,
err
:=
ioutil
.
ReadFile
(
pa
)
req
,
err
:=
http
.
NewRequest
(
"PUT"
,
url
.
String
(),
bytes
.
NewReader
(
imgData
))
res
,
err
:=
client
.
Do
(
req
)
if
u
.
username
!=
""
{
req
.
SetBasicAuth
(
u
.
username
,
u
.
password
)
}
res
,
err
:=
http
.
DefaultClient
.
Do
(
req
)
if
err
!=
nil
{
return
""
,
err
...
...
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