Skip to main content
Glama
test-auth-fix.js1.35 kB
#!/usr/bin/env node /** * Test the authentication header fix */ // First, let's compile the TypeScript import { execSync } from "child_process"; console.log("🏗️ Building project..."); execSync("npm run build", { stdio: "inherit" }); // Now test import { WordPressClient } from "../dist/client/api.js"; // Create a test client const client = new WordPressClient({ baseUrl: "https://test.example.com", auth: { method: "app-password", username: "testuser", appPassword: "xxxx yyyy zzzz aaaa bbbb cccc", }, }); // Test the addAuthHeaders method directly console.log("\n🔧 Testing addAuthHeaders method:"); const testHeaders = { "Content-Type": "application/json", }; client.addAuthHeaders(testHeaders); console.log("Headers after addAuthHeaders:", testHeaders); // Check if Authorization header was added if (testHeaders.Authorization) { console.log("✅ Authorization header added successfully!"); console.log(` Value: ${testHeaders.Authorization}`); // Decode to verify const decoded = Buffer.from(testHeaders.Authorization.replace("Basic ", ""), "base64").toString(); console.log(` Decoded: ${decoded}`); } else { console.log("❌ Authorization header NOT added!"); } console.log( "\n✨ Fix has been implemented. The authentication headers should now be properly included in POST requests.", );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/docdyhr/mcp-wordpress'

If you have feedback or need assistance with the MCP directory API, please join our Discord server