ipfs / boxo

A set of reference libraries for building IPFS applications and implementations in Go.
https://github.com/ipfs/boxo#readme
Other
181 stars 83 forks source link

gateway: add Content-Location for non-default response formats #603

Closed hacdias closed 3 months ago

hacdias commented 3 months ago

Addresses https://github.com/orgs/ipshipyard/projects/1/views/1?pane=issue&itemId=58406852 Close https://github.com/ipfs/boxo/issues/606

Specs PR: https://github.com/ipfs/specs/pull/471

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 60.57%. Comparing base (2f8a18d) to head (f96974f).

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #603      +/-   ##
==========================================
+ Coverage   59.72%   60.57%   +0.84%     
==========================================
  Files         238      238              
  Lines       29831    29462     -369     
==========================================
+ Hits        17817    17846      +29     
+ Misses      10405    10001     -404     
- Partials     1609     1615       +6     
Files Coverage Δ
gateway/gateway.go 83.54% <ø> (ø)
gateway/handler.go 79.62% <100.00%> (+1.34%) :arrow_up:
gateway/handler_car.go 79.89% <100.00%> (+1.28%) :arrow_up:
gateway/hostname.go 74.36% <100.00%> (+0.17%) :arrow_up:

... and 42 files with indirect coverage changes

hacdias commented 3 months ago

@lidel before I open a PR for the specifications, we should decide what to do with CAR requests that contain "parameters" in the Accept header itself (e.g. dups, order).

These cannot be translated into query URL parameters, so the Content-Location header would not be fully correct. For now, I am not adding it. I wonder if we shouldn't instead make it possible to also set these parameters through the URL, or just keep is as it is.

hacdias commented 3 months ago

@lidel I've opened a PR in the specs repository: https://github.com/ipfs/specs/pull/471