projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
14287: Add ensure_unique_name param to untrash options.
[arvados.git]
/
sdk
/
go
/
httpserver
/
error.go
diff --git
a/sdk/go/httpserver/error.go
b/sdk/go/httpserver/error.go
index 1ccf8c04782fbf57aedfe6cb20f75c50ef53cb9d..b222e18ea1159e67b9069c086207dbc3585c8e26 100644
(file)
--- a/
sdk/go/httpserver/error.go
+++ b/
sdk/go/httpserver/error.go
@@
-14,10
+14,7
@@
type ErrorResponse struct {
}
func Error(w http.ResponseWriter, error string, code int) {
}
func Error(w http.ResponseWriter, error string, code int) {
- w.Header().Set("Content-Type", "application/json")
- w.Header().Set("X-Content-Type-Options", "nosniff")
- w.WriteHeader(code)
- json.NewEncoder(w).Encode(ErrorResponse{Errors: []string{error}})
+ Errors(w, []string{error}, code)
}
func Errors(w http.ResponseWriter, errors []string, code int) {
}
func Errors(w http.ResponseWriter, errors []string, code int) {