Skip to content

Commit 78454a0

Browse files
committed
Revert "refactor(store/expapi): suppress false positive from gosec linter"
This reverts commit bb06c97.
1 parent 890f733 commit 78454a0

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

store/expapi/expapi.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,12 @@ func retrieve(conn driver.Conn) http.Handler {
9898
if errors.Is(err, driver.ErrNotExist) {
9999
http.Error(w, fmt.Sprintf("key %q not found", key), http.StatusNotFound)
100100
} else {
101-
http.Error(
102-
w,
103-
fmt.Sprintf("failed to get value for key %q: %v", key, err),
104-
http.StatusInternalServerError,
105-
)
101+
http.Error(w, fmt.Sprintf("failed to get value for key %q: %v", key, err), http.StatusInternalServerError)
106102
}
107103
return
108104
}
109105
w.Header().Set("Content-Type", "application/octet-stream")
110-
w.Header().Set("X-Content-Type-Options", "nosniff")
111106
w.WriteHeader(http.StatusOK)
112-
//nolint:gosec // G705: debug/admin endpoint intentionally returns raw cache bytes (not HTML rendering).
113107
if _, err := w.Write(value); err != nil {
114108
http.Error(
115109
w,
@@ -127,11 +121,7 @@ func destroy(conn driver.Conn) http.Handler {
127121
if errors.Is(err, driver.ErrNotExist) {
128122
http.Error(w, fmt.Sprintf("key %q not found", key), http.StatusNotFound)
129123
} else {
130-
http.Error(
131-
w,
132-
fmt.Sprintf("failed to delete value for key %q: %v", key, err),
133-
http.StatusInternalServerError,
134-
)
124+
http.Error(w, fmt.Sprintf("failed to delete value for key %q: %v", key, err), http.StatusInternalServerError)
135125
}
136126
return
137127
}

0 commit comments

Comments
 (0)