- Add global testTimeout (60s) and hookTimeout (30s) in vitest.config.js
- Increase timeouts for network-dependent tests in security, integration,
and container-registry test files
- Use HEAD requests where appropriate to reduce network overhead
- Fix lint error: change 'let scope' to 'const scope' in src/index.js
Standardized JSDoc type annotations across the codebase, replacing 'Object' with 'object' and refining function signatures for better type safety. Added and configured eslint-plugin-jsdoc for enhanced documentation linting, and updated ESLint settings to include adapters and new JSDoc rules. Updated dependencies to include eslint-plugin-jsdoc and related packages.
Moves Git, Git LFS, and authentication header forwarding tests from integration.test.js into dedicated feature test files under test/features/. Updates range-cache, security, and container-registry tests for consistency and minor improvements. Refactors src/index.js for code style and readability, especially around cache logic and error handling.
Introduces adapters for Vercel, Netlify Edge, Deno Deploy, and Cloudflare Pages, each with platform-specific entry points and configuration files. Adds a GitHub Actions CI workflow for linting, type checking, and testing. Updates lint scripts to include adapters, improves type annotations in src/index.js, and fixes a type assertion in security tests.
Refactored the main request handler in src/index.js for improved readability and error handling. Enhanced Docker request detection in validation.js to include additional Content-Type checks. Updated tests to increase timeouts and expand expected status codes for container registry platforms.
Moved Docker/OCI protocol handling, performance monitoring, security, and validation logic into dedicated modules under src/protocols and src/utils. Updated src/index.js to use these new modules, improving maintainability and separation of concerns. Added pre-computed sorted platform keys for efficient matching in platform config.
Added logic to remove the cr/[registry]/ prefix from the scope parameter and handle official Docker Hub images by adding the library/ prefix. Updated tests to verify correct scope transformation for Docker Hub, GHCR, and official images.
Introduces src/types.d.ts and test/types.d.ts for Cloudflare Workers and test utilities. Enhances JSDoc comments and type annotations across test files for better type safety and clarity. Updates tsconfig.json to use bundler module resolution and include additional type sources. Minor test logic and assertion improvements for robustness.
Refines regex patterns for URL rewriting and authentication parsing, ensures parseInt uses radix 10 throughout, and updates test mocks and helpers for consistency. Also adds more global variables to ESLint config, improves error handling, and removes unused code in tests.
Modularizes test helpers into separate files for assertions, generators, and mocks, and updates imports for platform tests. Adds new tests to verify Authorization header forwarding for authenticated requests. Cleans up and simplifies test setup, and updates fixtures for clarity and maintainability.
Update request handling to redirect root, invalid platform prefixes, and platform prefixes without resource paths to the homepage. Adjust tests to expect 302 redirects instead of 404 or 400 responses for these cases.
Added GitHub Gist ('gist') to the supported platforms in the configuration, updated documentation in both English and Chinese READMEs, and included related tests to ensure correct path transformation and base URL.
Introduces detection and handling for Git LFS (Large File Storage) operations, including LFS-specific endpoints, headers, and user agents. Updates request validation, header management, and cache logic to properly support LFS requests and ensure real-time data synchronization. Adds comprehensive integration and unit tests for LFS scenarios, and documents the new behavior in CLAUDE.md.
This commit adds support for Docker Hub (registry-1.docker.io) as a container registry platform with special authentication handling for official images.
Changes:
- Add 'cr-docker' platform pointing to https://registry-1.docker.io in platforms.js
- Implement special authentication scope handling for Docker Hub official images
- Docker Hub stores official images (nginx, redis, etc.) as library/nginx, library/redis
- Single-component image names are automatically prefixed with 'library/' for authentication
- Multi-component names (user/image) are passed through unchanged
- Add comprehensive tests for Docker Hub support
This resolves the issue where pulling public images from Docker Hub would prompt for authentication incorrectly. The library prefix is now automatically added to the authentication scope for single-name images, allowing proper anonymous access to public official images.
Test coverage:
- Official images (single-name): /cr/docker/v2/nginx/manifests/latest
- User images (namespaced): /cr/docker/v2/nginxinc/nginx-unprivileged/manifests/latest
- GET and HEAD request methods verified
All Docker Hub specific tests pass.
Enhances caching strategy to only cache 200 responses (not 206), supports serving range requests from cached full content, and avoids compression for media files to ensure proper byte-range support. Adds comprehensive tests for range request caching, media file handling, cache key management, and performance metrics.
Introduces Jenkins plugin and update center mirror support in README and platform config. Updates transformPath logic for Jenkins endpoints and adds comprehensive tests for Jenkins path handling and URL construction.
Introduces Kaggle as a supported platform in the configuration and health check. Implements special path transformation logic for Kaggle API endpoints in transformPath, and adds comprehensive tests to verify correct path handling for various Kaggle API routes.
Added 'civitai' to the PLATFORMS config and updated tests to include Civitai path transformations. This enables handling of Civitai URLs in the platform configuration and ensures correct path transformation logic.
Revised README to clarify 'AI 推理 API' terminology, updated Gemini API example URLs to use 'gemini-2.5-flash', and adjusted the related test case in platforms.test.js to match the new Gemini API path.
Renamed several AI provider keys and references (e.g., 'ip-google' to 'ip-gemini', 'ip-mistral' to 'ip-mistralai', etc.) in the codebase, documentation, and tests for improved clarity and alignment with provider branding. Updated README usage examples and provider tables to match the new keys.
Expanded and reordered the list of AI inference providers in the platform configuration to include new providers such as ip-github, ip-nvidia, ip-braintrust, ip-jina, ip-voyageai, ip-burncloud, and ip-poe. Updated the corresponding test to match the new provider list and order.
Added major AI/ML inference providers to the PLATFORMS config. Introduced comprehensive tests to ensure all providers are defined, their paths are transformed correctly, and valid URLs are constructed.
Added Homebrew, Homebrew API, and Homebrew Bottles platform support in the configuration. Updated the README with Homebrew usage instructions and examples. Introduced comprehensive tests for Homebrew path transformations to ensure correct behavior.
This commit removes all code, documentation, and tests related to the PyTorch platform. PyTorch is no longer listed as a supported platform in the configuration, README files, or test suites.
Refactors PyTorch path transformation logic and enhances URL rewriting for PyTorch wheel index pages to handle both absolute and relative links. Removes unnecessary cache skipping for PyTorch index pages and adds dedicated tests for PyTorch URL rewriting and path transformation.
Introduces PyTorch platform support with URL rewriting for wheel index pages in src/index.js. Updates documentation in both English and Chinese READMEs to reflect new PyTorch installation URLs and verification steps. Adds comprehensive tests for PyTorch proxying, URL transformation, and error handling in test/index.test.js and new test/pytorch.test.js.
Introduces PyTorch as a supported platform in the configuration, updates test utilities and test cases for PyTorch URLs, and adds detailed usage and acceleration instructions for PyTorch in both English and Chinese README files.
Changed references of ggplot2 from version 3.4.4 to 3.5.2 in both English and Chinese README files and updated related test cases in cran.test.js to ensure consistency with the latest package version.
Added openSUSE to the supported platforms in the documentation and configuration. Updated README with openSUSE usage instructions and examples. Introduced tests to verify openSUSE path transformation logic.
Added CRAN (R package repository) support to the platform configuration and updated the README with usage instructions and examples for CRAN. Introduced tests for CRAN path transformation and configuration in a new test/cran.test.js file.
Added Rust crates.io platform support in the documentation and platforms config. Implemented special path transformation logic for crates.io API endpoints in transformPath. Added tests to verify correct path transformation for various crates.io API routes.
Added support and documentation for additional platforms including Gitea, Codeberg, SourceForge, Maven, Gradle, RubyGems, Go, NuGet, Packagist, and various Linux distributions. Expanded usage examples and configuration instructions for these platforms, improved clarity and consistency in language, and updated sections on Git global acceleration, academic resource acceleration, and package manager integration. Minor language and formatting improvements throughout. Also updated a test README for clearer language.
Extended platform support by adding Gitea, Codeberg, and SourceForge to the configuration and documentation. Updated tests to cover new platforms and their path transformations, and enhanced README with usage examples and badges for the new platforms.