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
9080a588
Commit
9080a588
authored
Jan 11, 2018
by
Steven Allen
Committed by
Jeromy
Jan 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
golint: fix variable name
License: MIT Signed-off-by:
Steven Allen
<
steven@stebalien.com
>
parent
6bf29205
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
core/corehttp/commands.go
core/corehttp/commands.go
+2
-2
core/corehttp/option_test.go
core/corehttp/option_test.go
+1
-1
No files found.
core/corehttp/commands.go
View file @
9080a588
...
...
@@ -20,7 +20,7 @@ import (
)
var
(
errA
pi
VersionMismatch
=
errors
.
New
(
"api version mismatch"
)
errA
PI
VersionMismatch
=
errors
.
New
(
"api version mismatch"
)
)
const
originEnvKey
=
"API_ORIGIN"
...
...
@@ -157,7 +157,7 @@ func CheckVersionOption() ServeOption {
clientVersion
:=
r
.
UserAgent
()
// skips check if client is not go-ipfs
if
clientVersion
!=
""
&&
strings
.
Contains
(
clientVersion
,
"/go-ipfs/"
)
&&
daemonVersion
!=
clientVersion
{
http
.
Error
(
w
,
fmt
.
Sprintf
(
"%s (%s != %s)"
,
errA
pi
VersionMismatch
,
daemonVersion
,
clientVersion
),
http
.
StatusBadRequest
)
http
.
Error
(
w
,
fmt
.
Sprintf
(
"%s (%s != %s)"
,
errA
PI
VersionMismatch
,
daemonVersion
,
clientVersion
),
http
.
StatusBadRequest
)
return
}
}
...
...
core/corehttp/option_test.go
View file @
9080a588
...
...
@@ -20,7 +20,7 @@ type testcasecheckversion struct {
func
(
tc
testcasecheckversion
)
body
()
string
{
if
!
tc
.
shouldHandle
&&
tc
.
responseBody
==
""
{
return
fmt
.
Sprintf
(
"%s (%s != %s)
\n
"
,
errA
pi
VersionMismatch
,
config
.
ApiVersion
,
tc
.
userAgent
)
return
fmt
.
Sprintf
(
"%s (%s != %s)
\n
"
,
errA
PI
VersionMismatch
,
config
.
ApiVersion
,
tc
.
userAgent
)
}
return
tc
.
responseBody
...
...
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