download() > Accept: application/zip for ZIP files - #834
Conversation
|
Warning Review limit reached
Next review available in: 12 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesCURL download header propagation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@commons.sh`:
- Line 445: Change CURL_HEADERS from a single string to a shell array containing
separate -H and header arguments, then update all six curl call sites to expand
it with "${CURL_HEADERS[@]}" so each argument is passed separately.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 3ff9dba3-2f9a-4c2d-ae1e-23f54d5696b0
📒 Files selected for processing (1)
commons.sh
Accept: application/zipdownload() > Accept: application/zip for ZIP files
There was a problem hiding this comment.
Pull request overview
This PR updates the shared download() helper in commons.sh to send an explicit Accept: application/zip header when downloading ZIP artifacts, improving server-side content negotiation for ZIP endpoints.
Changes:
- Add conditional request headers for CURL when the downloaded file is a
.zip. - Thread the new header list through all CURL download paths (normal, insecure, and legacy renegotiation).
Suppressed comments (2)
commons.sh:455
- The new ZIP
Acceptheader is only applied to CURL. If CURL fails and this function falls back to WGET (a few lines below), the WGET request won’t include the header, so ZIP endpoints that require this header may still fail in the fallback path.
$CURL_ "${CURL_HEADERS[@]}" --user-agent "$USER_AGENT" --location --output "${NEW_FILE}" --time-cond "${LAST_FILE}" --max-time "$TIMEOUT_SEC" --retry 3 "$URL";
commons.sh:486
- Same issue in the no-last-file path: the WGET fallback (below) doesn’t include the ZIP
Acceptheader, so behavior diverges from CURL and may still fail for ZIP endpoints that require it.
$CURL_ "${CURL_HEADERS[@]}" --insecure --user-agent "$USER_AGENT" --location --output "${NEW_FILE}" --max-time "$TIMEOUT_SEC" --retry 3 "$URL";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…er': - commons: `download()` > `Accept: application/zip` for ZIP files mtransitapps/commons#834 - commons: Add initial .pr_agent.toml configuration file - commons: Add Qodo config to `.pr_agent.toml` mtransitapps/commons#833 - commons-android: `Schedule.Timestamp` KT ext mtransitapps/commons-android#191 - commons-android: Add initial .pr_agent.toml configuration file - commons-java: Add initial .pr_agent.toml configuration file - parser: Add initial .pr_agent.toml configuration file
- commons: `mt-download.yml` > omit `--ref` on default branch to avoid `mt-sync-code-data.yml` starting with the wrong hash mtransitapps/commons#835 - commons: `download()` > `Accept: application/zip` for ZIP files mtransitapps/commons#834
…parser': - commons: `download()` > remove `Accept: application/zip` for ZIP files (revert #834) - commons: Add `detekt` mtransitapps/commons#836 - commons: `mt-download.yml` > omit `--ref` on default branch to avoid `mt-sync-code-data.yml` starting with the wrong hash mtransitapps/commons#835 - commons: `download()` > `Accept: application/zip` for ZIP files mtransitapps/commons#834 - commons-android: GTFS-RT > Trip Updates > never ignore CANCELLED trips because too much into the future mtransitapps/commons-android#194 - commons-android: `Schedule` > + `hasRealTimeOrCancelled` - commons-android: Add `detekt` mtransitapps/commons-android#193 - commons-android: GTFS-RT > ignore trip updates too much into the future... mtransitapps/commons-android#192 - commons-java: Add `detekt` mtransitapps/commons-java#46 - parser: Add `detekt` mtransitapps/parser#84
…parser': - commons: `download()` > remove `Accept: application/zip` for ZIP files (revert #834) - commons: Add `detekt` mtransitapps/commons#836 - commons: `mt-download.yml` > omit `--ref` on default branch to avoid `mt-sync-code-data.yml` starting with the wrong hash mtransitapps/commons#835 - commons: `download()` > `Accept: application/zip` for ZIP files mtransitapps/commons#834 - commons-android: GTFS-RT > Trip Updates > never ignore CANCELLED trips because too much into the future mtransitapps/commons-android#194 - commons-android: `Schedule` > + `hasRealTimeOrCancelled` - commons-android: Add `detekt` mtransitapps/commons-android#193 - commons-android: GTFS-RT > ignore trip updates too much into the future... mtransitapps/commons-android#192 - commons-java: Add `detekt` mtransitapps/commons-java#46 - parser: Add `detekt` mtransitapps/parser#84
…parser': - commons: `download()` > remove `Accept: application/zip` for ZIP files (revert #834) - commons: Add `detekt` mtransitapps/commons#836 - commons: `mt-download.yml` > omit `--ref` on default branch to avoid `mt-sync-code-data.yml` starting with the wrong hash mtransitapps/commons#835 - commons: `download()` > `Accept: application/zip` for ZIP files mtransitapps/commons#834 - commons-android: GTFS-RT > Trip Updates > never ignore CANCELLED trips because too much into the future mtransitapps/commons-android#194 - commons-android: `Schedule` > + `hasRealTimeOrCancelled` - commons-android: Add `detekt` mtransitapps/commons-android#193 - commons-android: GTFS-RT > ignore trip updates too much into the future... mtransitapps/commons-android#192 - commons-java: Add `detekt` mtransitapps/commons-java#46 - parser: Add `detekt` mtransitapps/parser#84
…parser': - commons: `download()` > remove `Accept: application/zip` for ZIP files (revert #834) - commons: Add `detekt` mtransitapps/commons#836 - commons: `mt-download.yml` > omit `--ref` on default branch to avoid `mt-sync-code-data.yml` starting with the wrong hash mtransitapps/commons#835 - commons: `download()` > `Accept: application/zip` for ZIP files mtransitapps/commons#834 - commons-android: GTFS-RT > Trip Updates > never ignore CANCELLED trips because too much into the future mtransitapps/commons-android#194 - commons-android: `Schedule` > + `hasRealTimeOrCancelled` - commons-android: Add `detekt` mtransitapps/commons-android#193 - commons-android: GTFS-RT > ignore trip updates too much into the future... mtransitapps/commons-android#192 - commons-java: Add `detekt` mtransitapps/commons-java#46 - parser: Add `detekt` mtransitapps/parser#84
No description provided.