Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
b8189bef
Commit
b8189bef
authored
Aug 24, 2018
by
Nate Mara
Committed by
Sander van Harmelen
Aug 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change from using url.Opaque to url.Path and url.RawPath (#455)
parent
5f59a31d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
gitlab.go
gitlab.go
+9
-3
No files found.
gitlab.go
View file @
b8189bef
...
...
@@ -500,8 +500,14 @@ func (c *Client) SetBaseURL(urlStr string) error {
// request body.
func
(
c
*
Client
)
NewRequest
(
method
,
path
string
,
opt
interface
{},
options
[]
OptionFunc
)
(
*
http
.
Request
,
error
)
{
u
:=
*
c
.
baseURL
// Set the encoded opaque data
u
.
Opaque
=
c
.
baseURL
.
Path
+
path
unescaped
,
err
:=
url
.
PathUnescape
(
path
)
if
err
!=
nil
{
return
nil
,
err
}
// Set the encoded path data
u
.
RawPath
=
c
.
baseURL
.
Path
+
path
u
.
Path
=
c
.
baseURL
.
Path
+
unescaped
if
opt
!=
nil
{
q
,
err
:=
query
.
Values
(
opt
)
...
...
@@ -681,7 +687,7 @@ type ErrorResponse struct {
}
func
(
e
*
ErrorResponse
)
Error
()
string
{
path
,
_
:=
url
.
QueryUnescape
(
e
.
Response
.
Request
.
URL
.
Opaque
)
path
,
_
:=
url
.
QueryUnescape
(
e
.
Response
.
Request
.
URL
.
Path
)
u
:=
fmt
.
Sprintf
(
"%s://%s%s"
,
e
.
Response
.
Request
.
URL
.
Scheme
,
e
.
Response
.
Request
.
URL
.
Host
,
path
)
return
fmt
.
Sprintf
(
"%s %s: %d %s"
,
e
.
Response
.
Request
.
Method
,
u
,
e
.
Response
.
StatusCode
,
e
.
Message
)
}
...
...
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