brightspace-mcp-server 3.13.19 → 3.13.20

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.
@@ -12,6 +12,7 @@ import { secureDownload, readBodyCapped } from "../utils/download-helpers.js";
12
12
  import { DownloadError } from "../utils/download-errors.js";
13
13
  import { MAX_FILE_SIZE } from "../utils/file-validator.js";
14
14
  import { extractPdfText } from "../utils/pdf-extractor.js";
15
+ import { parseContentDispositionFilename } from "./download-file.js";
15
16
  import { log } from "../utils/logger.js";
16
17
  import path from "node:path";
17
18
  import fs from "node:fs/promises";
@@ -172,10 +173,8 @@ export function registerGetSyllabus(server, apiClient) {
172
173
  }
173
174
  // Get filename from Content-Disposition header
174
175
  const disposition = response.headers.get("Content-Disposition") ?? "";
175
- const match = disposition.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);
176
- if (match?.[1]) {
177
- attachmentFilename = match[1].replace(/['"]/g, "");
178
- }
176
+ attachmentFilename =
177
+ parseContentDispositionFilename(disposition) || attachmentFilename;
179
178
  // Download body as buffer
180
179
  // Capped read: Content-Length can be missing or understated.
181
180
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brightspace-mcp-server",
3
- "version": "3.13.19",
3
+ "version": "3.13.20",
4
4
  "mcpName": "io.github.RohanMuppa/brightspace",
5
5
  "description": "MCP server for Brightspace (D2L). Check grades, due dates, assignments, announcements, syllabus, rosters and more via Claude, ChatGPT, Cursor, Windsurf, or any MCP client.",
6
6
  "type": "module",