Skip to content

Conversation

Copy link

Copilot AI commented Nov 4, 2025

The File class constructor expects a file path, but was being passed $attachment->filetype (MIME type string) instead of $attachment->path.

Changes

  • Line 276 (file() method): Changed new File($attachment->filetype) to new File($attachment->path)
  • Line 300 (download() method): Changed new File($attachment->filetype) to new File($attachment->path)

Both methods use the File instance to call $file->lastChange() for the Last-Modified header, which requires a valid file path.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: busgurlu <1284742+busgurlu@users.noreply.github.com>
Copilot AI changed the title [WIP] Add changes based on feedback from PR #2 Fix File constructor calls in file() and download() methods Nov 4, 2025
Copilot AI requested a review from busgurlu November 4, 2025 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants