Skip to content

Commit 9eef52b

Browse files
JAORMXclaude
andcommitted
fix: resolve lint issues in server and dashboard
- Add ReadHeaderTimeout to http.Server to satisfy gosec G114 - Add explicit void return types to arrow functions in mcp-client.ts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 890776b commit 9eef52b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

cmd/minder-mcp/main.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,13 @@ func main() {
8686
addr := fmt.Sprintf(":%d", cfg.MCP.Port)
8787
slog.Info("Starting Minder MCP server", "addr", addr, "endpoint", cfg.MCP.EndpointPath)
8888

89-
if err := http.ListenAndServe(addr, corsHandler); err != nil {
89+
srv := &http.Server{
90+
Addr: addr,
91+
Handler: corsHandler,
92+
ReadHeaderTimeout: 10 * time.Second,
93+
}
94+
95+
if err := srv.ListenAndServe(); err != nil {
9096
slog.Error("Failed to start server", "error", err)
9197
os.Exit(1)
9298
}

ui/compliance-dashboard/src/mcp-client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class MCPAppsClient {
6464
*/
6565
onToolResult(callback: ToolResultCallback): void {
6666
this.onToolResultCallback = callback;
67-
this.app.ontoolresult = (result) => {
67+
this.app.ontoolresult = (result): void => {
6868
console.log('[MCP] Received tool result notification:', result);
6969
if (this.onToolResultCallback) {
7070
this.onToolResultCallback(result);
@@ -78,7 +78,7 @@ export class MCPAppsClient {
7878
*/
7979
onToolInput(callback: ToolInputCallback): void {
8080
this.onToolInputCallback = callback;
81-
this.app.ontoolinput = (input) => {
81+
this.app.ontoolinput = (input): void => {
8282
console.log('[MCP] Received tool input notification:', input);
8383
if (this.onToolInputCallback) {
8484
this.onToolInputCallback(input);
@@ -92,7 +92,7 @@ export class MCPAppsClient {
9292
*/
9393
onDimensionsChange(callback: DimensionsCallback): void {
9494
this.onDimensionsCallback = callback;
95-
this.app.onhostcontextchanged = (context) => {
95+
this.app.onhostcontextchanged = (context): void => {
9696
console.log('[MCP] Received host context change:', context);
9797
if (context.containerDimensions && this.onDimensionsCallback) {
9898
const dims = context.containerDimensions as ContainerDimensions;

0 commit comments

Comments
 (0)