-
-
Notifications
You must be signed in to change notification settings - Fork 761
fix(aqua): fix 403 forbidden error for aqua:gitea.com/gitea/tea #5647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Fixes 403 errors when fetching attachments from Gitea by using GET requests instead of HEAD, and adds an end-to-end test for the Gitea tea package.
- Use HTTP GET for Gitea URLs in
AquaBackend::Httpto work around missing HEAD support - Add an E2E test for
aqua:gitea.com/gitea/[email protected]
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/backend/aqua.rs | Detect gitea.com URLs and use HTTP.get_async instead of HEAD |
| e2e/backend/test_aqua | Add test case for tea --version including ANSI-formatted output |
Comments suppressed due to low confidence (1)
src/backend/aqua.rs:268
- The new GET branch for Gitea URLs isn't covered by existing unit tests. Consider adding a unit or integration test that mocks HTTP requests to verify this branch behaves as expected and handles errors correctly.
HTTP.get_async(&url).await?;
| let url = pkg.url(v)?; | ||
| HTTP.head(&url).await?; | ||
| // Gitea doesn't support HEAD requests for attachments, so use GET instead | ||
| if url.contains("gitea.com") { |
Copilot
AI
Jul 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using url.contains("gitea.com") may unintentionally match substrings in paths or query parameters. Consider parsing the URL with a proper URL parser (e.g., url::Url::parse(&url)) and checking the host directly to ensure accuracy.
Co-authored-by: Copilot <[email protected]>
Resolves #5643.
However, since this is a patch only for
aqua:gitea.com/gitea/tea, as it's the only package using Gitea, I don't think we should fix this on our end.I opened an issue go-gitea/gitea#35086.