mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 15:19:10 +02:00
* feat: Add encoding parameter to FileResource - Add optional encoding field (str | None, default None) to FileResource. - Pass encoding through to read_text() for cross-platform text file reading. - Preserve backward compatibility by defaulting to system encoding. * test: Add tests for FileResource encoding parameter - Test UTF-8 reading with explicit encoding for non-ASCII content. - Test backward compatibility when no encoding is specified. - Test that encoding is ignored for binary file reads. - Test Latin-1 reading with matching encoding. * docs: Document FileResource encoding parameter - Add encoding="utf-8" to FileResource example in resource classes guide. - Update FileResource description to mention encoding support. * feat: Change FileResource encoding default from None to utf-8 - Default to utf-8 instead of system encoding to prevent cross-platform footgun. - Update field description to reflect new default. - Update test to verify default encoding is utf-8 with non-ASCII content. - Remove redundant encoding="utf-8" from docs example since it is now the default. |
||
|---|---|---|
| .. | ||
| auth | ||
| providers | ||
| transforms | ||
| authorization.mdx | ||
| composition.mdx | ||
| context.mdx | ||
| dependency-injection.mdx | ||
| elicitation.mdx | ||
| icons.mdx | ||
| lifespan.mdx | ||
| logging.mdx | ||
| middleware.mdx | ||
| pagination.mdx | ||
| progress.mdx | ||
| prompts.mdx | ||
| resources.mdx | ||
| sampling.mdx | ||
| server.mdx | ||
| storage-backends.mdx | ||
| tasks.mdx | ||
| telemetry.mdx | ||
| testing.mdx | ||
| tools.mdx | ||
| versioning.mdx | ||
| visibility.mdx | ||