Skip to main content
Glama

Carbon Voice

by PhononX
obfuscate-auth-headers.ts520 B
import { IncomingHttpHeaders } from 'http'; const AUTH_HEADERS = ['authorization', 'x-api-key']; export const removeLastChars = (str: string) => { return str?.substring(0, str.length - 5) + '<omitted>'; }; export const obfuscateAuthHeaders = ( headers: IncomingHttpHeaders, ): IncomingHttpHeaders => { return Object.fromEntries( Object.entries(headers).map(([key, value]) => [ key, AUTH_HEADERS.includes(key?.toLowerCase()) ? removeLastChars(`${value}`) : value, ]), ); };

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/PhononX/cv-mcp-server'

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