uv
007f52bb - Add support for relative URLs in simple metadata responses (#721)

Commit
1 year ago
Add support for relative URLs in simple metadata responses (#721) ## Summary This PR adds support for relative URLs in the simple JSON responses. We already support relative URLs for HTML responses, but the handling has been consolidated between the two. Similar to index URLs, we now store the base alongside the metadata, and use the base when resolving the URL. Closes #455. ## Test Plan `cargo test` (to test HTML indexes). Separately, I also ran `cargo run -p puffin-cli -- pip-compile requirements.in -n --index-url=http://localhost:3141/packages/pypi/+simple` on the `zb/relative` branch with `packse` running, and forced both HTML and JSON by limiting the `accept` header.
Author
Parents
  • crates
    • distribution-types/src
      • File
        base_url.rs
      • File
        index_url.rs
      • File
        lib.rs
    • puffin-client/src
      • File
        html.rs
      • File
        lib.rs
      • File
        registry_client.rs
    • puffin-distribution/src
      • File
        distribution_database.rs
      • File
        source_dist.rs
    • puffin-resolver/src
      • File
        candidate_selector.rs
      • File
        error.rs
      • File
        finder.rs
      • File
        pins.rs
      • File
        resolution.rs
      • File
        resolver.rs
    • pypi-types/src
      • File
        base_url.rs
      • File
        lib.rs
      • File
        simple_json.rs