@emreyc/swagger-mcp 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -223,11 +223,16 @@ function normalizeTags(spec, endpoints) {
|
|
|
223
223
|
var SpecLoadError = class extends Error {
|
|
224
224
|
};
|
|
225
225
|
var cache = /* @__PURE__ */ new Map();
|
|
226
|
+
var fetchHeaders = {
|
|
227
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
|
|
228
|
+
Accept: "application/json, application/yaml, text/yaml, */*",
|
|
229
|
+
"Accept-Language": "en"
|
|
230
|
+
};
|
|
226
231
|
async function fetchAndNormalize(docsUrl) {
|
|
227
232
|
let bundled;
|
|
228
233
|
try {
|
|
229
234
|
bundled = await SwaggerParser.bundle(docsUrl, {
|
|
230
|
-
resolve: { http: { safeUrlResolver: false } }
|
|
235
|
+
resolve: { http: { safeUrlResolver: false, headers: fetchHeaders } }
|
|
231
236
|
});
|
|
232
237
|
} catch (err) {
|
|
233
238
|
const reason = err instanceof Error ? err.message : String(err);
|