Skip to content

Commit 7781476

Browse files
committed
fix: treat 4xx responses as success
1 parent e7dda01 commit 7781476

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hostinger-api-mcp",
3-
"version": "0.0.24",
3+
"version": "0.0.25",
44
"description": "MCP server for Hostinger API",
55
"repository": {
66
"type": "git",

server.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2512,7 +2512,7 @@ const SECURITY_SCHEMES = {
25122512

25132513
/**
25142514
* MCP Server for Hostinger API
2515-
* Generated from OpenAPI spec version 0.0.73
2515+
* Generated from OpenAPI spec version 0.0.76
25162516
*/
25172517
class MCPServer {
25182518
constructor() {
@@ -2530,7 +2530,7 @@ class MCPServer {
25302530
this.server = new Server(
25312531
{
25322532
name: "hostinger-api-mcp",
2533-
version: "0.0.24",
2533+
version: "0.0.25",
25342534
},
25352535
{
25362536
capabilities: {
@@ -2555,7 +2555,7 @@ class MCPServer {
25552555
});
25562556
}
25572557

2558-
headers['User-Agent'] = 'hostinger-mcp-server/0.0.24';
2558+
headers['User-Agent'] = 'hostinger-mcp-server/0.0.25';
25592559

25602560
return headers;
25612561
}
@@ -2679,6 +2679,9 @@ class MCPServer {
26792679
method: method.toLowerCase(),
26802680
url,
26812681
headers: { ...this.headers },
2682+
validateStatus: function (status) {
2683+
return status < 500; // Resolve only if the status code is less than 500
2684+
}
26822685
};
26832686

26842687
// Apply security headers based on tool security requirements

server.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2528,7 +2528,7 @@ const SECURITY_SCHEMES: Record<string, SecurityScheme> = {
25282528

25292529
/**
25302530
* MCP Server for Hostinger API
2531-
* Generated from OpenAPI spec version 0.0.73
2531+
* Generated from OpenAPI spec version 0.0.76
25322532
*/
25332533
class MCPServer {
25342534
private server: Server;
@@ -2550,7 +2550,7 @@ class MCPServer {
25502550
this.server = new Server(
25512551
{
25522552
name: "hostinger-api-mcp",
2553-
version: "0.0.24",
2553+
version: "0.0.25",
25542554
},
25552555
{
25562556
capabilities: {
@@ -2575,7 +2575,7 @@ class MCPServer {
25752575
});
25762576
}
25772577

2578-
headers['User-Agent'] = 'hostinger-mcp-server/0.0.24';
2578+
headers['User-Agent'] = 'hostinger-mcp-server/0.0.25';
25792579

25802580
return headers;
25812581
}
@@ -2698,6 +2698,9 @@ class MCPServer {
26982698
method: method.toLowerCase(),
26992699
url,
27002700
headers: { ...this.headers },
2701+
validateStatus: function (status: number): boolean {
2702+
return status < 500; // Resolve only if the status code is less than 500
2703+
}
27012704
};
27022705

27032706
// Apply security headers based on tool security requirements

0 commit comments

Comments
 (0)