Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
69a7cac5
Unverified
Commit
69a7cac5
authored
3 years ago
by
Charlie Voiselle
Browse files
Options
Download
Email Patches
Plain Diff
Fixup: Use `http` consts for response codes
parent
9f651beb
Branches unavailable
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
command/agent/secure_variable_endpoint.go
+2
-2
command/agent/secure_variable_endpoint.go
with
2 additions
and
2 deletions
+2
-2
command/agent/secure_variable_endpoint.go
+
2
-
2
View file @
69a7cac5
...
...
@@ -9,7 +9,7 @@ import (
func
(
s
*
HTTPServer
)
SecureVariablesListRequest
(
resp
http
.
ResponseWriter
,
req
*
http
.
Request
)
(
interface
{},
error
)
{
if
req
.
Method
!=
"GET"
{
return
nil
,
CodedError
(
405
,
ErrInvalidMethod
)
return
nil
,
CodedError
(
http
.
StatusMethodNotAllowed
,
ErrInvalidMethod
)
}
args
:=
structs
.
SecureVariablesListRequest
{}
...
...
@@ -64,7 +64,7 @@ func (s *HTTPServer) secureVariableQuery(resp http.ResponseWriter, req *http.Req
setMeta
(
resp
,
&
out
.
QueryMeta
)
if
out
.
Data
==
nil
{
return
nil
,
CodedError
(
404
,
"Secure variable not found"
)
return
nil
,
CodedError
(
http
.
StatusNotFound
,
"Secure variable not found"
)
}
return
out
.
Data
,
nil
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help