Skip to content

Show the full URL in download error messages - #1642

Open
filbranden wants to merge 1 commit into
aptly-dev:masterfrom
filbranden:fix-download-url-opaque
Open

filbranden wants to merge 1 commit into
aptly-dev:masterfrom
filbranden:fix-download-url-opaque

Conversation

@filbranden

@filbranden filbranden commented Sep 21, 2026 •

Copy link
Copy Markdown

Requirements

  • All new code should be covered with tests, documentation should be updated. CI should pass.
  • Also, to speed up things, if you could kindly "Allow edits and access to secrets by maintainers" in the
    PR settings, as this allows us to rebase the PR on master, fix conflicts, run coverage and help with
    implementing code and tests.

Description of the Change

Downloads set req.URL.Opaque to keep "+" percent-encoded in the path. URL.String() prints "scheme:opaque" and drops the host, so every error from the http client showed a URL such as "https:/repos/debian/...", lacking a host name. The request itself was correct, but the message sent me to look for a malformed URL.

Set req.URL.RawPath instead. The escaping still reaches the wire through EscapedPath(), and String() keeps the scheme and the host.

The proxy special case is no longer necessary. Requests through a proxy now get the same "+" escaping as direct requests.

Checklist

  • allow Maintainers to edit PR (rebase, run coverage, help with tests, ...)
  • unit-test added (if change is algorithm)
  • functional test added/updated (if change is functional)
  • man page updated (if applicable)
  • bash completion updated (if applicable)
  • documentation updated
  • author name in AUTHORS

Downloads set req.URL.Opaque to keep "+" percent-encoded in the path.
URL.String() prints "scheme:opaque" and drops the host, so every error
from the http client showed a URL such as "https:/repos/debian/...",
lacking a host name. The request itself was correct, but the message
sent me to look for a malformed URL.

Set req.URL.RawPath instead. The escaping still reaches the wire through
EscapedPath(), and String() keeps the scheme and the host.

The proxy special case is no longer necessary. Requests through a proxy
now get the same "+" escaping as direct requests.
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.06%. Comparing base (f59b0d2) to head (0c77313).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1642      +/-   ##
==========================================
- Coverage   77.37%   77.06%   -0.32%     
==========================================
  Files         165      165              
  Lines       15747    15744       -3     
==========================================
- Hits        12185    12133      -52     
- Misses       2356     2409      +53     
+ Partials     1206     1202       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@filbranden

Copy link
Copy Markdown
Author

CI failures are due to bullseye-security having gone away.

@filbranden

Copy link
Copy Markdown
Author

#1643 to address dropping bullseye from the CI.

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.

1 participant